Exemplo n.º 1
0
 // If player is attacking and hits a tentacle, destroy it.
 void OnTriggerEnter(Collider other)
 {
     if ((other.transform.name == "Collide") && ((this.transform.name == "col1") || (this.transform.name == "col2")))
     {
         if (pCtrl.isAttacking)
         {
             tnt.DestroyMe();
         }
         else
         {
             pStats.life -= 10;
         }
     }
 }