Files
2026-01-01 22:00:33 +08:00

32 lines
882 B
C#

// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
using UnityEngine;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour;
#endif
namespace WaveHarmonic.Crest.Editor
{
[ExecuteAlways]
abstract class RenderPipelinePatcher : MonoBehaviour
{
#if UNITY_EDITOR
protected virtual void OnEnable()
{
RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged;
RenderPipelineManager.activeRenderPipelineTypeChanged += OnActiveRenderPipelineTypeChanged;
}
protected virtual void OnDisable()
{
RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged;
}
protected abstract void OnActiveRenderPipelineTypeChanged();
#endif
}
}