Table of Contents

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
Object
ScriptableObject
CharacterLayerDefinitionSO
Implements

Properties

AttachedCharacterType

public LayeredCharacterTypeSO AttachedCharacterType { get; }

Property Value

LayeredCharacterTypeSO

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

bool

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

bool

LayerName

The name used for the layer. Does NOT need to be unique.

public string LayerName { get; }

Property Value

string

Remarks

Used when displaying layer names in the Character Creator.

LayerOptions

public IReadOnlyList<CharacterLayerOption> LayerOptions { get; }

Property Value

IReadOnlyList<CharacterLayerOption>

Methods

AcquireAllLayerOptionsAsync(Action<float>)

public Task AcquireAllLayerOptionsAsync(Action<float> onProgress = null)

Parameters

onProgress Action<float>

Returns

Task

CollectLayerOptions_EditMode()

[Button("Collect Layer Options", EButtonEnableMode.Editor)]
public void CollectLayerOptions_EditMode()

GetLayerOptionFromIndex(int)

public CharacterLayerOption GetLayerOptionFromIndex(int index)

Parameters

index int

Returns

CharacterLayerOption

GetLayerOptionFromKey(string)

public CharacterLayerOption GetLayerOptionFromKey(string key)

Parameters

key string

Returns

CharacterLayerOption

GetLayerOptionFromSpritesheetName(string)

public CharacterLayerOption GetLayerOptionFromSpritesheetName(string spritesheetName)

Parameters

spritesheetName string

Returns

CharacterLayerOption

Initialize(LayeredCharacterTypeSO)

public bool Initialize(LayeredCharacterTypeSO characterType)

Parameters

characterType LayeredCharacterTypeSO

The 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

bool

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()