Exemplo n.º 1
0
 void OnCollisionEnter(Collision collision)
 {
     Debug.Log("Ganador");
     if (collision.gameObject.tag == "Goal")
     {
         gameManager.EndGame(collision.gameObject.GetComponent <Coche>().id, Gamemanager.VictoryType.goal);
     }
 }
Exemplo n.º 2
0
    public void Die()
    {
                gameObject.SetActive(false);

        Gamemanager gameManager = FindObjectOfType <Gamemanager>();

        gameManager.EndGame();
    }
Exemplo n.º 3
0
    public void LosePoints(int newPoints)
    {
        points   -= newPoints;
        text.text = "Vidas: " + points + "/5";

        if (points <= 0)
        {
            gameManager.EndGame(id, Gamemanager.VictoryType.death);
        }
    }
Exemplo n.º 4
0
    void OnTriggerEnter2D(Collider2D Get)
    {
        if (Get.gameObject.tag.Equals("Ladder"))
        {
            if (!m_ladder)
            {
                m_ladder = true;
                anim.SetBool("isLadder", true);
                this.transform.Translate(0, 0.05f, 0);
            }
        }

        if (Get.gameObject.tag.Equals("End"))
        {
            //game clear
            Gamemanager.EndGame();
            Playsound("FINISH");
            Time.timeScale = 0;
        }
    }