public void Decrease(float damage) { currentLife -= damage; if (currentLife <= 0) { patientController.Die(); //tod an patientController } Lifebar.fillAmount = currentLife / MaxHealth; }
/* * IEnumerator HEALING_EnterState() { * yield return new WaitForSeconds(patientTimeOut); * if ((GameStates)currentState == GameStates.HEALING) { * currentPatient.Die(); * currentState = GameStates.DEAD; * } * } */ void HEALING_Update() { patientTime -= Time.deltaTime; if (patientTime <= 0.0f) { currentPatient.Die(); currentState = GameStates.DEAD; } }