Esempio n. 1
0
    public void Eat(Edible edible)
    {
        if (!edible.DestroyOnEat)
        {
            ShowWin();
        }

        PlayRandomSound(eats);
        edible.Eat();

        if (!edible.isPoison())
        {
            Hunger += edible.HungerRestored;
        }
        else
        {
            Invoke("Poisoned", 0.5f);
            Invoke("Poisoned", 0.9f);
        }

        if (Hunger > MaxHunger)
        {
            Hunger = MaxHunger;
        }
    }