void OnCollisionEnter(Collision collision) { Debug.Log("Ganador"); if (collision.gameObject.tag == "Goal") { gameManager.EndGame(collision.gameObject.GetComponent <Coche>().id, Gamemanager.VictoryType.goal); } }
public void Die() { gameObject.SetActive(false); Gamemanager gameManager = FindObjectOfType <Gamemanager>(); gameManager.EndGame(); }
public void LosePoints(int newPoints) { points -= newPoints; text.text = "Vidas: " + points + "/5"; if (points <= 0) { gameManager.EndGame(id, Gamemanager.VictoryType.death); } }
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; } }