Exemplo n.º 1
0
    private void PlaySoundFromHealSource(HealSource healSource)
    {
        switch (healSource)
        {
        case HealSource.BOTTLE:
            AudioManager.Instance.PlayClip("Drink", transform.position, false, transform);
            break;

        case HealSource.MISC:
            AudioManager.Instance.PlayClip("Drink", transform.position, false, transform);
            break;
        }
    }
Exemplo n.º 2
0
 virtual public void Heal(float amount, HealSource healSource = HealSource.BOTTLE)
 {
     Health += amount;
     Health  = Mathf.Clamp(Health, 0.0f, MaxHealth);
     PlaySoundFromHealSource(healSource);
 }