Exemplo n.º 1
0
 /// <summary> Appel la fonction Exit() du vieux state et le Enter() du nouveau </summary>
 /// <param name="newState"> Nouveau state </param>
 public void ChangeState(IStates newState)
 {
     currentState.Exit();
     previousState = currentState;
     currentState  = newState;
     currentState.Enter();
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     _actor       = GetComponent <IActor> ();
     StartNode    = grid.PostoNode(_actor.Position);
     currentState = calcState;
     currentState.Enter();
 }
Exemplo n.º 3
0
 public Rescuer(OrientedActor actor, OrientedActor teammate)
 {
     self         = actor;
     teamMate     = teammate;
     rescueState  = new RescueState(self, teamMate);
     currentState = rescueState;
     currentState.Enter();
 }
Exemplo n.º 4
0
    public void ChangeState(IStates newState)
    {
        if (currentState != null)
        {
            currentState.Exit();
        }

        currentState = newState;
        currentState.Enter(this);
    }
Exemplo n.º 5
0
 public void ToSad()
 {
     currentState.ResetPathColor();
     currentState = new SadState(self);
     currentState.Enter();
 }
Exemplo n.º 6
0
 public void ToHappy()
 {
     currentState.ResetPathColor();
     currentState = new HappyState(self);
     currentState.Enter();
 }
Exemplo n.º 7
0
 /// <summary> Retourne au state precedent </summary>
 public void SwitchToPreviousState()
 {
     currentState.Exit();
     currentState = previousState;
     currentState.Enter();
 }
Exemplo n.º 8
0
 void Awake()
 {
     mCurrentState = new StandingState();
     mCurrentState.Enter(this);
 }