To customize StateBehaviour, you need to create a script file for StateBehaviour and describe what you want to do.
Create StateBehaviour script file
- Right-click on the location you want to create from the Project window.
- From the right-click menu, and select “Create> Arbor > State Behaviour C# Script”.
- Determined to enter the file name
Function to be called
By assigning the created StateBehaviour to the state in ArborEditor, each function of the script will be called.
It is called when it first enters the state.
It is called when transitioning to state.
It will be called every frame at the timing of Update() of MonoBehaviour.
It will be called every frame at the timing of LateUpdate() of MonoBehaviour.
It is called when leaving the state.
- MonoBehaviour message functions
For details, please see the MonoBehaviour Messages of Unity ScriptReference.
- For enabled of MonoBehaviour are used internally already for execution control, please use the behaviourEnabled to be a substitute.
- OnStateAwake / OnStateBegin / OnStateUpdate / OnStateLateUpdate / OnStateEnd is called in order from the top attached to the state node in Arbor Editor.
- MonoBehaviour messages are invoked according to the order of execution by Unity.
For details, refer to Execution Order of Event Functions in Unity Manual.
Variables and Arbor Editor
You can edit it in Arbor Editor by declaring a variable with public or SerializeField attribute added to the created script.
By declaring StateLink with the public or SerializeField attribute added to the created script, connection slots will be displayed in Arbor Editor.
Transition to connection destination
It is referred to as the Transition in the transition you want to timing.
It is possible to input / output values by data flow.
For details, see “Scripting: Data flow”.