예제 #1
0
파일: Building.cs 프로젝트: kkaren/ES2016B
 // Receive damage by weapon
 public void ReceiveDamage(float damage)
 {
     try
     {
         health.LoseHealth(damage);
         NotifyHUD();
         ApplyMainTexture();
         ApplySmokeEffect();
     }
     catch (Exception)
     {
         NotifyHUD();
         GameController.instance.notifyDeath(this);
     }
 }
예제 #2
0
파일: Unit.cs 프로젝트: kkaren/ES2016B
 // 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();
     }
 }