Exemple #1
0
    private void ConsumeTreat()
    {
        IItem item = m_treats.Find(p => p.Position.x == m_player.Position.x && p.Position.y == m_player.Position.y);

        if (item != null)
        {
            if (item is Treat)
            {
                Treat treat = (Treat)item;
                m_effectSource.clip = m_carrotEffect;
                //m_effectSource.volume = 0.15f;
                m_effectSource.Play();
                m_score += treat.Value;
            }
            else if (item is Detonator)
            {
                m_hunter.DetonateMines();
                m_effectSource.clip = m_explosionEffect;
                m_effectSource.Play();
            }
            RecycleTreat(item);
        }
    }