Ejemplo n.º 1
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.name == "bullet(Clone)")
     {
         EnemyLives -= 1;
         Debug.Log("Hit!");
     }
     if (collision.gameObject.name == "Player")
     {
         gameManager.Invoke("instaDeath", 0.1f);
     }
 }
Ejemplo n.º 2
0
 void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.name == "Player")
     {
         Destroy(this.transform.parent.gameObject);
         Debug.Log("Item Collected");
         gameManager.Items += 1;
         if (this.gameObject.name == "Invincibility")
         {
             gameManager.isTickingDamage = false;
             gameManager.Invoke("resetTickingDamage", 10f);
         }
         if (this.gameObject.name == "Invisibility")
         {
             enemy.isTracking = false;
             enemy.Invoke("resetisTracking", 5f);
         }
     }
 }