Ejemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     newState = currentState.DoState(this);
     if (currentState != newState)
     {
         //so if we DO change states. we will call Init,
         //then DoState will be called next frame. So dont have Init call DoState();
         currentState = newState;
         currentState.InitState(this);
     }
 }
Ejemplo n.º 2
0
 void Start()
 {
     currentState = idleInactiveState;
     currentState.InitState(this);
 }