This commit is contained in:
zhangjiajia
2026-05-06 16:56:59 +08:00
parent 575626d3e1
commit 81ffaaeca6
1373 changed files with 145920 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
namespace WaveHarmonic.Crest.Editor
{
#if !CREST_DEBUG
[AddComponentMenu("")]
#endif
[RequireComponent(typeof(Camera))]
sealed class RenderPipelineCameraPatcher : RenderPipelinePatcher
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
#if UNITY_EDITOR
protected override void OnActiveRenderPipelineTypeChanged()
{
if (PrefabStageUtility.GetCurrentPrefabStage() != null)
{
return;
}
if (!isActiveAndEnabled)
{
return;
}
#if d_UnityHDRP
if (RenderPipelineHelper.IsHighDefinition)
{
if (TryGetComponent<HDAdditionalCameraData>(out var data))
{
// This component will try to modify serialized HDR & MSAA properties every frame. Disgusting.
data.enabled = true;
}
}
#endif
}
#endif
}
}