コード例 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         Damage();
     }
     void Damage()
     {
         healthController.playerHealth = healthController.playerHealth - SpikeDamage;
         healthController.UpdateHealth();
         this.gameObject.SetActive(false);
     }
 }
コード例 #2
0
 void Move()
 {
     healthController.playerHealth = healthController.playerHealth - bombDamage;
     healthController.UpdateHealth();
     SoundManagerScript.PlaySound("hit");
 }
コード例 #3
0
ファイル: MedKit.cs プロジェクト: NuclearLion/Dodge-The-Edges
 void Damage()
 {
     healthController.playerHealth = healthController.playerHealth - vDamage;
     healthController.UpdateHealth();
     this.gameObject.SetActive(false);
 }
コード例 #4
0
 public void Damage()
 {
     healthController.currentHealth = healthController.currentHealth - damage;
     healthController.UpdateHealth();
     this.gameObject.SetActive(false);
 }