UniRxをベースにしたステートマシン
state-machineはUniRxをベースにしたステートマシンです
releases からstate-machine.unitypackageをダウンロードしてプロジェクトにインポートしてください
Unity2019.4以上はGitHubから直接追加できます。この方法はPackage Managerから更新を受け取れないので手動で更新します。
https://github.com/neuecc/UniRx.git?path=Assets/Plugins/UniRx/Scripts
を貼り付けますhttps://github.com/tomori-hikage/state-machine.git?path=state-machine/Assets/StateMachine
を貼り付けますusing UnityEngine;
using UniRx;
using HC.AI;
[DisallowMultipleComponent]
public class Example : State
{
#region event
private void Start()
{
BeginStream.Subscribe(_ => Debug.Log("State Begin"));
UpdateStream.Subscribe(_ => Debug.Log("State Update"));
FixedUpdateStream.Subscribe(_ => Debug.Log("State FixedUpdate"));
LateUpdateStream.Subscribe(_ => Debug.Log("State LateUpdate"));
EndStream.Subscribe(_ => Debug.Log("State End"));
OnDrawGizmosStream.Subscribe(_ => Debug.Log("State OnDrawGizmos"));
OnGUIStream.Subscribe(_ => Debug.Log("State OnGUI"));
}
#endregion
}
JINZO
GitHub: @JINZO631
Twitter: @jinzo_631
takaaptech
GitHub: @takaaptech
chorome
GitHub: @chromee
state-machineはUniRxをベースに作成しています