예제 #1
0
    private void Die()
    {
        m_currentState = CurrentState.Dead;
        m_animationController.Die();

        Debug.Log("<color=red>" + gameObject.name + " has died!</color>");
    }
 public void BeHurt(float damage)
 {
     currenthp -= damage;
     bloodChangeEvent.Invoke(maxhp, currenthp);
     if (currenthp <= 0)
     {
         currenthp = 0;
         if (isControl)
         {
             BattleManager.Instance.GameDefeated();
             chaAnimationCon.Die();
             characterCon.enabled = false;
             isControl            = false;
         }
     }
     else
     {
         chaAnimationCon.Injured();
         BattleUIController.Instance.Injured();
     }
 }