// Start is called before the first frame update void Start() { //aqui llamaremos las animacion del jugador, al igual que localizar los componentes del UImngr para poder actualizar las vidas. animator = GetComponent <Animator>(); UiManager = GameObject.Find("UIMngr").GetComponent <UIMngr>(); if (UiManager != null) { UiManager.ActualizarVidas(Jugadorvida); } }
//aqui se denotara el daño que se le realizar al jugador, restandole vidas y actualizandolo en pantalla public void Damage() { Jugadorvida--; UiManager.ActualizarVidas(Jugadorvida); if (Jugadorvida <= 0) { //Instantiate(MuerteJugadorPrefab, transform.position, Quaternion.identity); Destroy(this.gameObject); GameOvr(); //GameOver(); } }