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