Ejemplo n.º 1
0
    public void Eat()
    {
        if (hit || isObstacle)
        {
            return;
        }

        // Gives as much score as he restores hp
        dyno.UpdateHP(hpRestore);
        GameManager.Instance.Score += hpRestore;

        if (givesGodmode)
        {
            dyno.EnableGodmode();
        }

        if (givesBerserk)
        {
            dyno.EnableBerserk();
        }

        dead = true;
        if (isPickup)
        {
            sfx.Pickup();
        }
        else
        {
            sfx.Splatter();
            GameManager.Instance.PoolManager.SpawnBlood(this.transform);
        }

        GameManager.Instance.PoolManager.RemoveFromScene(gameObject);
    }