コード例 #1
0
 public void TakeDamage(float amount)
 {
     if (lastHit + DelayFromTakeDamage < Time.time && !m_Dead)
     {
         lastHit = Time.time;
         Debug.Log("Player take damage");
         pAnimC.GetHit();
         m_CurrentHealth -= amount;
         if (m_CurrentHealth <= 0f && !m_Dead)
         {
             m_CurrentHealth = 0;
             OnDeath();
         }
         SetHealthUI();
         SetLight();
     }
 }