Ejemplo n.º 1
0
 // Receive damage by weapon
 public void ReceiveDamage(float damage)
 {
     try
     {
         health.LoseHealth(damage);
         NotifyHUD();
         ApplyMainTexture();
         ApplySmokeEffect();
     }
     catch (Exception)
     {
         NotifyHUD();
         GameController.instance.notifyDeath(this);
     }
 }
Ejemplo n.º 2
0
 // Receive damage by weapon
 public void ReceiveDamage(float damage)
 {
     try
     {
         health.LoseHealth(damage);
         NotifyHUD();
         //change texture if hp is bellow 50%
         if (health.GetCurrentHealthPercentage() < damageThreshold)
         {
             skin.material.mainTexture = damagedTexture;
         }
     }
     catch (Exception)
     {
         NotifyHUD();
         Die();
     }
 }