Exemple #1
0
    //HealHealthAndMana() is called when in a healing zone and heals the player's health and mana.
    public void HealHealthAndMana()
    {
        HP   += Time.deltaTime * 3;
        mana += Time.deltaTime * 3;

        if (HP > 100)
        {
            HP = 100;
        }
        if (mana > 100)
        {
            mana = 100;
        }
        if (HP == 100 && mana == 100)
        {
            HealingAudio.Stop(); //if health and mana are full, make sure the sound effect has stopped.
        }
        //Update the HUD to show the replenishment.
        UpdateHUDText();
    }
Exemple #2
0
 //Stops the healing sound effect
 public void StopHealingAudio()
 {
     HealingAudio.Stop();
 }
Exemple #3
0
 //Plays the healing sound effect
 public void PlayHealingAudio()
 {
     HealingAudio.Play();
 }