/// <summary> /// Unregisters a previously registered component /// </summary> /// <param name="sender">The new component to be unregistered</param> public void UnregisterSubcameraModifier(ISubCameraModifier sender) { subcameraModifiers.Remove(sender); if (_subCameras != null) { foreach (var camera in subCameras) { sender.UnregisterCommandBuffersSubCamera(camera); } sender.UnregisterCommandBuffersMainCamera(linkedCamera); } }
/// <summary> /// Registers a new component that needs to modify every subcamera, it must implement the /// ISubcameraModifier interface. /// /// The methods in the interface will be called when needed /// </summary> /// <param name="sender">The new component to be registered</param> public void RegisterSubcameraModifier(ISubCameraModifier sender) { subcameraModifiers.Add(sender); if (_subCameras != null) { if (_stitchCommandBuffer != null) { sender.RegisterCommandBuffersMainCamera(linkedCamera); } foreach (var camera in subCameras) { sender.RegisterCommandBuffersSubCamera(camera); } } }