Пример #1
0
 public void TakeDamage(float damage)
 {
     if (m_Invulnerable)
     {
         return;
     }
     if (m_health - damage >= 0)
     {
         m_health -= damage;
     }
     if (m_health - damage < 0)
     {
         m_health = 0;
     }
     m_Invulnerable = true;
     m_animator.SetTrigger("Damaged");
     if (m_currentAttack != null && damage > 10 && m_currentAttack.IsDisruptable())
     {
         m_currentAttack.StopAttack();
     }
 }