Input slot

Data can be output by declaring an input slot such as InputSlotInt.

Example script

Create a TestInputSlotBehaviour script file and write the following code.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
using UnityEngine;
using Arbor;

[AddComponentMenu("")]
public class TestInputSlotBehaviour : StateBehaviour
{
	public InputSlotInt inputSlot;

	public override void OnStateBegin()
	{
		int intValue = 0;
		if (inputSlot.GetValue(ref intValue))
		{
			Debug.Log("inputSlot : " + intValue);
		}
		else
		{
			Debug.LogWarning("inputSlot : not connected.");
		}
	}
}

When this script is added to the state of ArborFSM, it becomes as follows.

Input slot class