Summary
Call this after deserializing to properly initialize the
Animancer.FSM.StateMachine`1.CurrentState
.- Assembly
- Animancer
.dll - Namespace
- Animancer
.FSM - Containing Type
- StateMachine
<TKey, TState>
Syntax
public override void InitializeAfterDeserialize()
Examples
public class MyComponent : MonoBehaviour
{
[SerializeField]
private CharacterState.StateMachine _StateMachine;
protected virtual void Awake()
{
_StateMachine.InitializeAfterDeserialize();
}
}
Remarks
Unfortunately,
UnityEngine.ISerializationCallbackReceiver
can't be used to automate this because many
Unity functions aren't available during serialization such as getting or setting a
UnityEngine.Behaviour.enabled
like Animancer.FSM.StateBehaviour.OnEnterState
does.
Return Value
Type | Description |
---|---|
void |