public void GetDamage(float damage) { if (currentLife > 0) { currentLife -= damage; if (currentLife <= 0) { Destroy(gameObject); gameManager.SearchEnemy(gameObject); //Debug.Log("Se murió el enemy"); animatorController.SetBool(deadAnimation, true); characterinputScript.GetKilled(); } else { animatorController.SetTrigger("GetHitted"); } } }
public void GetDamage(float damage) { Debug.Log("GetDamage del Player"); if (currentLife > 0) { currentLife -= damage; UIM.updateLifeBar(currentLife); Debug.Log("currentLife: " + currentLife); if (currentLife <= 0) { Debug.Log("Murio el player"); animatorController.SetTrigger("Died"); animatorController.SetBool("IsRunning", false); characterinputScript.GetKilled(); looseEvent.Invoke(); } else { animatorController.SetTrigger("GetHitted"); } } }