예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         SceneConfig.KillPlayer();
     }
 }
예제 #2
0
 // Start is called before the first frame update
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.collider.tag == "Player")
     {
         SceneConfig.KillPlayer();
     }
 }
예제 #3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        float fallSpeed = GetComponent <Rigidbody2D>().velocity.y;

        if (collision.collider.tag == "Player" && fallSpeed < -1)
        {
            SceneConfig.KillPlayer();
        }
    }