public FSMTransition(FSMCondition condition, FSMAction[] actions = null)
 {
     myCondition = condition;
     if (actions != null)
     {
         myActions.AddRange(actions);
     }
 }
Esempio n. 2
0
    void Start()
    {
        FSMCondition bt = BlueTime;
        FSMCondition rt = RedTime;

        FSMTransition t1 = new FSMTransition(bt);
        FSMTransition t2 = new FSMTransition(rt);

        FSMState Red = new FSMState();

        Red.enterActions.Add(GoRed);

        FSMState Blue = new FSMState();

        Blue.enterActions.Add(GoBlue);

        Blue.AddTransition(t2, Red);
        Red.AddTransition(t1, Blue);

        fsm = new FSM(Red);
    }
Esempio n. 3
0
 public FSMTransition(FSMCondition condition, FSMAction[] actions = null)
 {
     Condition   = condition;
     fireActions = actions;
 }