Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         controller.AttackPlayer();
     }
 }
Exemplo n.º 2
0
 // called when smth hits the closed bridge
 void OnCollisionEnter2D(Collision2D col)
 {
     Debug.Log("AAAAAAAAAAAAAAAAAAAAAAAA COLLISION");
     Debug.Log("AAAAAAAAAAAAAa " + col.gameObject);
     if (col.gameObject.tag == "Player")
     {
         controller.AttackPlayer();
     }
 }
Exemplo n.º 3
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         controller.AttackPlayer();
         Destroy(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }