Version: 2023.1
언어: 한국어

RenderPipelineManager.activeRenderPipelineDisposed

매뉴얼로 전환

설명

Delegate that you can use to invoke custom code right before RenderPipelineManager.currentPipeline is disposed.

Whenever you switch GraphicsSettings.currentRenderPipeline or QualitySettings.renderPipeline, Unity will dispose the current RenderPipeline before instantiate the new RenderPipeline. You can subscribe to this event to know when current RenderPipeline will be disposed. To access the currently disposing RenderPipeline object you can rely on RenderPipelineManager.currentPipeline.

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."); } }