Example #1
0
 public FSMState(string identifier, StateUpdateHandler updateHandler = null, StateEnteredCallback enteredCallback = null, StateExitedCallback exitedCallback = null)
 {
     this.Identifier = identifier;
     this.EnteredCallback = enteredCallback;
     this.ExitedCallback = exitedCallback;
     this.UpdateHandler = updateHandler;
 }
Example #2
0
 public FSMState(string identifier, StateUpdateHandler updateHandler = null, StateEnteredCallback enteredCallback = null, StateExitedCallback exitedCallback = null)
 {
     this.Identifier      = identifier;
     this.EnteredCallback = enteredCallback;
     this.ExitedCallback  = exitedCallback;
     this.UpdateHandler   = updateHandler;
 }
Example #3
0
    public void AddStateUpdateCallback(BattleStates state, StateUpdateHandler handler)
    {
        if (state <= 0 || state >= BattleStates.Count || handler == null)
        {
            return;
        }

        m_stateHandlers[(int)state] -= handler;
        m_stateHandlers[(int)state] += handler;
    }
 public void AddState(string state, StateUpdateHandler updateHandler = null, StateEnteredCallback enteredCallback = null, StateExitedCallback exitedCallback = null)
 {
     _states[state] = new FSMState(state, updateHandler, enteredCallback, exitedCallback);
 }
 /// <summary>
 /// Change the state -- the parent object registers a state by passing a reference to the parent's state handler.
 /// ex:  "m_stateMachine.SetState (UpdateCountDown2);"  sets the current state handler to "UpdateCountdown2"
 /// </summary>
 public void SetState(StateUpdateHandler newState)
 {
     if(CurrentState != newState)
         CurrentState = newState;
 }
Example #6
0
 public void AddState(string state, StateUpdateHandler updateHandler = null, StateEnteredCallback enteredCallback = null, StateExitedCallback exitedCallback = null)
 {
     _states[state] = new FSMState(state, updateHandler, enteredCallback, exitedCallback);
 }