/// <summary> /// Unregisters a volume from the manager /// </summary> /// <param name="volume">The volume to remove</param> public void Unregister(AuraVolume volume) { _culler.Unregister(volume); if (_registredVolumes.Contains(volume)) { _registredVolumes.Remove(volume); volume.OnTextureMaskStateChanged -= Volume_onTextureMaskStateChanged; volume.OnTextureMaskChanged -= Volume_onTextureMaskChanged; } }
/// <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); }