public void SwitchLight()
    {
        int count = speciallights.Count;

        activeLightposition += 1;

        if (count == 0)
        {
            return;
        }

        if (activeLight == null)
        {
            activeLight = speciallights[0];
            GameManager.ChangeColorTiles(activeLight.colorName);
            playerPointLight.color = activeLight.lightColor;
        }
        else
        {
            int nextIndex = speciallights.IndexOf(activeLight) + 1;
            if (nextIndex >= speciallights.Count)
            {
                nextIndex = 0;
            }
            if (nextIndex == speciallights.IndexOf(activeLight))
            {
                return;
            }

            activeLight = speciallights[nextIndex];
            GameManager.ChangeColorTiles(activeLight.colorName);
            playerPointLight.color = activeLight.lightColor;
        }
    }
 public void Add(SpecialLight l)
 {
     speciallights.Add(l);
     if (speciallights.Count == 1)
     {
         SwitchLight();
     }
 }
예제 #3
0
 public void Remove(SpecialLight o)
 {
     _Lights.Remove(o);
 }
예제 #4
0
 public void Add(SpecialLight o)
 {
     // Make sure the light doesn't already exist
     Remove(o);
     _Lights.Add(o);
 }