コード例 #1
0
 public void Damage(int damageTaken)
 {
     if (shieldActive)
     {
         playerShield.Damage(damageTaken);
     }
     else
     {
         damageSound.Play();
         health -= damageTaken;
         if (health <= 0)
         {
             Kill();
         }
         cameraShake.Shake();
         playerMaterial.color = Color.white;
         Invoke("ResetColor", 0.05f);
     }
 }