Exemplo n.º 1
0
 /// <summary>
 /// Sent when an incoming collider makes contact with this object's
 /// collider (2D physics only).
 /// </summary>
 /// <param name="other">The Collision2D data associated with this collision.</param>
 void OnCollisionEnter2D(Collision2D other)
 {
     Debug.Log("Sanity Check");
     if (other.gameObject.tag == "OverworldEnemy")
     {
         RPGun_GameManager manager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <RPGun_GameManager>();
         manager.TriggerFight(other.gameObject.GetComponent <RPGun_Enemy>());
     }
 }