本文整理汇总了C#中FSM.addTransition方法的典型用法代码示例。如果您正苦于以下问题:C# FSM.addTransition方法的具体用法?C# FSM.addTransition怎么用?C# FSM.addTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSM
的用法示例。
在下文中一共展示了FSM.addTransition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
mFSM = new FSM();
FSM.State state = mFSM.AddState("A");
state.SetEnterMethod(delegate() { Debug.Log("Enter A " + a); });
state.SetTickMethod(delegate(float dt) { });
state.SetExitMethod(delegate() { Debug.Log("Exit A " + a); });
state = mFSM.AddState("B");
state.SetEnterMethod(delegate() { Debug.Log("Enter B" + a); });
state.SetTickMethod(delegate(float dt) { });
state.SetExitMethod(delegate() { Debug.Log("Exit B " + a); });
mFSM.addTransition("A", "B", "!(A2B1 & (A2B1 | A2B2)) & !OK");
mFSM.addTransition("B", "A", "(B2A | B2A)");
mFSM.Begin();
InvokeRepeating("Test", 3.0f, 6.0f);
}
示例2: Start
void Start()
{
player = GetComponent<Player>();
//end = GetComponent<EndTurn>();
_fsm = new FSM<State>();
State[] states = (State[])Enum.GetValues(typeof(State));
foreach(State s in states)
{
_fsm.addState(s);
}
_fsm.current_state = State.Init;
_fsm.addTransition(State.Init, State.Idle, null);
_fsm.addTransition(State.Idle, State.Attack, player.Attack);
_fsm.addTransition(State.Attack, State.Idle, null);
_fsm.addTransition(State.Idle, State.Special, player.Special);
_fsm.addTransition(State.Special, State.Idle, null);
auto_idle();
}