Example #1
0
 public void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.tag == ("Player"))
     {
         PlayerController player = collision.gameObject.GetComponent <PlayerController>();
         player.StartPlayerDeath();
     }
 }
Example #2
0
 private void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.gameObject.layer == LayerMask.NameToLayer("Player"))
     {
         PlayerController player = coll.gameObject.GetComponent <PlayerController>();
         AudioPlayer.Instance.PlaySfx(PlayerLoseFx);
         player.StartPlayerDeath();
     }
 }