public void TakeHit() { health.TakeHit(1); StartCoroutine(box.TimedDeactivate(.25f)); //Flash UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP); }
public void Damage(float _damage) { isDamaged = true; currentHealth -= _damage; updateHealthUI.UpdateHealth(currentHealth); SoundEvents.Instance.Play("PLAYER_PAIN_v1_test", false); CameraShake.Shake(0.2f, 1f); if (currentHealth <= 0) { // Game Over Debug.Log("You r dead."); gameOverScript.SetActive(true); Time.timeScale = 0; SoundEvents.Instance.Play("LEVEL_FAILED_v1_test", false); } }
void Start() { player = FindObjectOfType <Player>(); UpdateHealthUI.UpdateHealth(player.GetComponent <Health>().MaxHP, player.GetComponent <Health>().CurrentHP); UpdateCoinUI.UpdateCoinText(Globals.Coins); }
public void HealPlayer(int amount) { health.Heal(amount); UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP); }