예제 #1
0
 public void ChangeState(IBossState newState)
 {
     if (currentState != null)
     {
         currentState.Exit();
     }
     currentState = newState;
     currentState.Enter(this);
 }
예제 #2
0
 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);
        }
    }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     currentState = spawnState;
 }
예제 #5
0
 public void ChangeState(IBossState newState)
 {
     currentState = newState;
     currentState.Enter();
 }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     currentState = jumpState;
 }
 private void Start()
 {
     currentState = idleInactiveState;
     currentState.InitState(this);
 }
 // Use this for initialization
 void Start()
 {
     currentState = spawnState;
 }