SwiftFSM:C#中轻巧优雅的FSM工具

时间:2024-06-05 23:28:35
【文件属性】:

文件名称:SwiftFSM:C#中轻巧优雅的FSM工具

文件大小:49KB

文件格式:ZIP

更新时间:2024-06-05 23:28:35

C#

SwiftFSM 一个轻量级的有限状态机实现 示例 enum MyState { StateA, StateB } enum MyEvent { EventA, EventB } public void TestBasicMachineBehaviour() { var machine = new StateMachine(); //指定初始状态 machine.Initialize(MyState.StateA); //定义状态跳转 machine .In(MyState.StateA) .ExecuteOnEnter(()=>{UnityEngine.Debug.Log("Enter State A");}) .ExecuteOnExit(()=>{UnityEngine.Debug.Log("Exit State A"


网友评论