コード例 #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();
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     _actor       = GetComponent <IActor> ();
     StartNode    = grid.PostoNode(_actor.Position);
     currentState = calcState;
     currentState.Enter();
 }
コード例 #3
0
ファイル: Rescuer.cs プロジェクト: MilkTicc/AI-Projects
 public Rescuer(OrientedActor actor, OrientedActor teammate)
 {
     self         = actor;
     teamMate     = teammate;
     rescueState  = new RescueState(self, teamMate);
     currentState = rescueState;
     currentState.Enter();
 }
コード例 #4
0
    public void ChangeState(IStates newState)
    {
        if (currentState != null)
        {
            currentState.Exit();
        }

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