public void Destroy() { foreach (var row in LevelGrid) { foreach (var obj in row) { MonoBehaviour.Destroy(obj.gameObject); } row.Clear(); } LevelGrid.Clear(); foreach (var obj in LevelEnvironmentObjects) { MonoBehaviour.Destroy(obj.gameObject); } LevelEnvironmentObjects.Clear(); foreach (var obj in LevelEnemies) { MonoBehaviour.Destroy(obj.gameObject); } LevelEnemies.Clear(); LightSourceMap.Clear(); LightSourceListenerMap.Clear(); ObstructionMap.Clear(); SpacePlayerOccupations.Clear(); }
public void ToggleLight(char lightSource) { if (LightSourceListenerMap.ContainsKey(lightSource)) { foreach (ILightSourceListener lightSourceListener in LightSourceListenerMap[lightSource]) { lightSourceListener.ToggleLight(); } } }
public void SetLightActive(char lightSource, bool state) { if (LightSourceListenerMap.ContainsKey(lightSource)) { foreach (ILightSourceListener lightSourceListener in LightSourceListenerMap[lightSource]) { lightSourceListener.SetLightActive(state); } } }