activeRenderPipelineDisposed
Delegate that you can use to invoke custom code right before RenderPipelineManager.currentPipeline is disposed.
Read time 1 minuteLast updated 7 days ago
Definition
- Type: Event
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
public static event Action activeRenderPipelineDisposed
Remarks
Whenever you switch GraphicsSettings.currentRenderPipeline or QualitySettings.renderPipeline, Unity will dispose the current before instantiate the new . You can subscribe to this event to know when current will be disposed. To access the currently disposing object you can rely on RenderPipelineManager.currentPipeline.
RenderPipelineRenderPipelineRenderPipelineRenderPipelineExamples
using UnityEngine;using UnityEngine.Rendering;public class CurrentRenderPipelineDisposedExample : MonoBehaviour{ void Start() { RenderPipelineManager.activeRenderPipelineDisposed += RenderPipelineManager_activeRenderPipelineDisposed; } private void OnDestroy() { RenderPipelineManager.activeRenderPipelineDisposed -= RenderPipelineManager_activeRenderPipelineDisposed; } private void RenderPipelineManager_activeRenderPipelineDisposed() { Debug.Log($"Render Pipeline {RenderPipelineManager.currentPipeline.GetType().Name} is disposing."); }}