public void ChangeState(IBossState newState) { if (currentState != null) { currentState.Exit(); } currentState = newState; currentState.Enter(this); }
private void BossTakeDamage() { life--; if (life == 0) { currentState = new IdleState(); bossAnimator.SetTrigger("Death"); soundManager.PlayBossDeath(); } }
private void Update() { newState = currentState.DoState(this); if (newState != currentState) { currentState = newState; currentState.InitState(this); } }
// Use this for initialization void Start() { currentState = spawnState; }
public void ChangeState(IBossState newState) { currentState = newState; currentState.Enter(); }
// Use this for initialization void Start() { currentState = jumpState; }
private void Start() { currentState = idleInactiveState; currentState.InitState(this); }
// Use this for initialization void Start() { currentState = spawnState; }