Exemplo n.º 1
0
    // Start is called before the first frame update

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            Debug.Log("You are dead!");
            ps.RestartLevel();
        }
    }
Exemplo n.º 2
0
    private void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.tag == "Ground")
        {
            isJump = false;
        }

        if (col.gameObject.tag == "Press")
        {
            ps.RestartLevel();
        }
    }