Ejemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "EndOfScene")
     {
         Debug.Log("TriggerEnter");
         MoveCamera.GetInstance().CameraCanMove = false;
     }
 }
Ejemplo n.º 2
0
    void OnTriggerExit2D(Collider2D col)
    {
        if (col.gameObject.tag == "EndOfScene")
        {
            Debug.Log("TriggerExit");
            MoveCamera.GetInstance().CameraCanMove = true;
        }

        if (col.gameObject.tag == "GroundCanJumpDown")
        {
            col.gameObject.GetComponent <Collider2D>().enabled = true;
            canjumpdown = false;
            jumpdown    = false;
        }

        if (col.gameObject.tag == "CheckPointR")
        {
            Debug.Log("Enter");
            ObstacleScript.instance.respawntrans.position = ObstacleScript.instance.respawntransR.position;
        }
    }