/// <summary> /// Unregisters an AuraLights /// </summary> /// <param name="light">The candidate light</param> /// <returns>True if unregistration went well, false otherwise</returns> public bool Unregister(AuraLight light) { if (_lights.Contains(light)) { if (light.cookieMapRenderTexture != null) { _cookieMapsCollector.RemoveTexture(light.cookieMapRenderTexture); } if (light.shadowMapRenderTexture != null) { _shadowmapsCollector.RemoveTexture(light.shadowMapRenderTexture); _shadowDataCollector.RemoveTexture(light.shadowDataRenderTexture); } _lights.Remove(light); SetupBuffers(); return(true); } return(false); }
/// <summary> /// Unregisters an AuraLights /// </summary> /// <param name="light">The candidate light</param> /// <returns>True if unregistration went well, false otherwise</returns> public bool Unregister(AuraLight light) // TODO : HANDLE SHADOW/COOKIE UNREGISTRATION AUTOMATICALLY { if (_lights.Contains(light)) { if (light.cookieMapRenderTexture != null) { _cookieMapsCollector.RemoveTexture(light.cookieMapRenderTexture); } if (light.shadowMapRenderTexture != null) { _shadowmapsCollector.RemoveTexture(light.shadowMapRenderTexture); } _culler.Unregister(light); _lights.Remove(light); return(true); } return(false); }