Class CharacterLayerDefinitionSO
- Namespace
- BlazerTech.CharacterManagement.Characters
- Assembly
- Assembly-CSharp.dll
[CreateAssetMenu(menuName = "BlazerTech/Character Management System/Layered Character Type/Layered Character Type", fileName = "New Character Layer")]
public class CharacterLayerDefinitionSO : ScriptableObject, IValidatable
- Inheritance
-
ObjectScriptableObjectCharacterLayerDefinitionSO
- Implements
Properties
AttachedCharacterType
public LayeredCharacterTypeSO AttachedCharacterType { get; }
Property Value
IncludeNoneOption
If toggled, adds a 'None' option as the first layer option. Applies immediately when toggled and when CollectLayerOptions_EditMode() is run.
public bool IncludeNoneOption { get; }
Property Value
IsValid
Gets a value indicating whether the object is currently valid.
This value should be updated when PerformValidationCheck() is called.
public bool IsValid { get; }
Property Value
LayerName
The name used for the layer. Does NOT need to be unique.
public string LayerName { get; }
Property Value
Remarks
Used when displaying layer names in the Character Creator.
LayerOptions
public IReadOnlyList<CharacterLayerOption> LayerOptions { get; }
Property Value
Methods
AcquireAllLayerOptionsAsync(Action<float>)
public Task AcquireAllLayerOptionsAsync(Action<float> onProgress = null)
Parameters
Returns
CollectLayerOptions_EditMode()
[Button("Collect Layer Options", EButtonEnableMode.Editor)]
public void CollectLayerOptions_EditMode()
GetLayerOptionFromIndex(int)
public CharacterLayerOption GetLayerOptionFromIndex(int index)
Parameters
index
int
Returns
GetLayerOptionFromKey(string)
public CharacterLayerOption GetLayerOptionFromKey(string key)
Parameters
key
string
Returns
GetLayerOptionFromSpritesheetName(string)
public CharacterLayerOption GetLayerOptionFromSpritesheetName(string spritesheetName)
Parameters
spritesheetName
string
Returns
Initialize(LayeredCharacterTypeSO)
public bool Initialize(LayeredCharacterTypeSO characterType)
Parameters
characterType
LayeredCharacterTypeSOThe LayeredCharacterTypeSO used to initialize the layer.
Returns
- bool
True if the layer was able to initialize properly. Otherwise, False.
Exceptions
- InvalidOperationException
Thrown when AttachedCharacterType is null.
- ArgumentNullException
Thrown when
characterType
is null.- ArgumentException
Thrown when the
characterType
is different from the one used in the layer.
IsInitialized()
public bool IsInitialized()
Returns
PerformValidationCheck()
Checks/Rechecks if the object is valid and updates IsValid accordingly.
public bool PerformValidationCheck()
Returns
- bool
true if the object is valid after the check; otherwise, false.
ReleaseAllLayerOptions()
public void ReleaseAllLayerOptions()