Esempio n. 1
0
 void ChangeState(ZombieStateEnum newState)
 {
     if (_currState != null)
     {
         _currState.OnExit(this);
     }
     _currState = _states[newState];
     _currState.OnEnter(this);
 }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (_remainHurtTime > 0.0f)
        {
            return;
        }

        ZombieStateEnum newState = _currState.Update(this);

        if (newState != ZombieStateEnum.None)
        {
            ChangeState(newState);
        }
    }