예제 #1
0
 void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.name == "Spacecraft")
     {
         hazardMaster.CallEventDestroyed();
         playerMaster.CallEventTakeDamage();
     }
 }
예제 #2
0
 private void ReduceHealth(int amount)
 {
     health -= amount;
     if (health <= 0)
     {
         hazardMaster.CallEventDestroyed();
     }
 }
예제 #3
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.layer == 12)
     {
         try {
             hazardMaster.CallEventDestroyed();
         } catch (System.Exception e) {
             Debug.Log(this.name + " - " + col.name);
             Debug.Log("\t" + e.Message + "!!!");
             Debug.Break();
         }
     }
 }