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(); } }
public void Remove(SpecialLight o) { _Lights.Remove(o); }
public void Add(SpecialLight o) { // Make sure the light doesn't already exist Remove(o); _Lights.Add(o); }