示例#1
0
 public void TakeHit()
 {
     health.TakeHit(1);
     StartCoroutine(box.TimedDeactivate(.25f));
     //Flash
     UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP);
 }
示例#2
0
    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);
        }
    }
示例#3
0
 void Start()
 {
     player = FindObjectOfType <Player>();
     UpdateHealthUI.UpdateHealth(player.GetComponent <Health>().MaxHP, player.GetComponent <Health>().CurrentHP);
     UpdateCoinUI.UpdateCoinText(Globals.Coins);
 }
示例#4
0
 public void HealPlayer(int amount)
 {
     health.Heal(amount);
     UpdateHealthUI.UpdateHealth(health.MaxHP, health.CurrentHP);
 }