Пример #1
0
    void UpdateLightingCreatures()
    {
        if (m_LightingCreatures.Count == 0)
        {
            return;
        }

        bool end = true;

        for (int i = 0; i < m_LightingCreatures.Count;)
        {
            LightingCreature lighting_creature = m_LightingCreatures[i];
            if (lighting_creature.Update() == true)
            {
                if (lighting_creature.IsEnd == false)
                {
                    end = false;
                }
                ++i;
            }
            else
            {
                m_LightingCreatures.RemoveAt(i);
            }
        }
        if (end == true)
        {
            EndLighting();
        }
    }
Пример #2
0
    public void RemoveLighting(ICreature creature)
    {
        LightingCreature lighting_creature = m_LightingCreatures.Find(c => c.Creature == creature);

        if (lighting_creature == null)
        {
            return;
        }

        lighting_creature.SetEnd(true);
    }