コード例 #1
0
 public void Affect(bool AddHealth, float Value)
 {
     if (AddHealth)
     {
         HP.AddHealth(Value);
     }
     else
     {
         HP.SubtractHealth(Value);
     }
 }
コード例 #2
0
ファイル: Building.cs プロジェクト: kkaren/ES2016B
 // Repair the building
 public void Repair()
 {
     if (!IsRepairable(GameObject.FindGameObjectWithTag("Human").GetComponent <Player>().GetNumCoins()))
     {
         return;
     }
     GameObject.FindGameObjectWithTag("Human").GetComponent <Player>().SpendCoins((int)repairCost);
     health.AddHealth(repairQuantity);
     NotifyHUD();
     ApplyMainTexture();
     ApplySmokeEffect();
     if (!repair.isPlaying)
     {
         repair.PlayOneShot(repair.clip);
     }
 }