升级6.4.升级水,升级天气

This commit is contained in:
2026-04-05 00:26:54 +08:00
parent 63bc9b5536
commit 5f7cbfb713
635 changed files with 34718 additions and 22567 deletions

View File

@@ -3,6 +3,7 @@
using UnityEngine;
using UnityEngine.Rendering;
using WaveHarmonic.Crest.Internal;
namespace WaveHarmonic.Crest.Editor
{
@@ -10,15 +11,16 @@ namespace WaveHarmonic.Crest.Editor
[AddComponentMenu("")]
#endif
[ExecuteAlways]
sealed class AmbientLightPatcher : MonoBehaviour
sealed class AmbientLightPatcher : CustomBehaviour
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
#if UNITY_EDITOR
void OnEnable() => InitializeAmbientLighting();
private protected override void OnEnable()
{
base.OnEnable();
InitializeAmbientLighting();
}
void Update() => InitializeAmbientLighting();
bool _Baked;

View File

@@ -6,6 +6,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using WaveHarmonic.Crest.Internal;
namespace WaveHarmonic.Crest.Examples
{
@@ -14,26 +15,28 @@ namespace WaveHarmonic.Crest.Examples
[AddComponentMenu("")]
#endif
[ExecuteAlways, RequireComponent(typeof(PostProcessVolume))]
sealed class LegacyPostProcessingVolume : MonoBehaviour
sealed class LegacyPostProcessingVolume : CustomBehaviour
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
[@Layer]
[SerializeField]
int _Layer;
readonly List<PostProcessVolume> _QuickVolumes = new();
void OnEnable()
private protected override void OnEnable()
{
base.OnEnable();
if (!RenderPipelineHelper.IsLegacy)
{
return;
}
if (Helpers.IsWebGPU)
{
return;
}
_QuickVolumes.Clear();
foreach (var volume in GetComponents<PostProcessVolume>())

View File

@@ -4,10 +4,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour;
#endif
using WaveHarmonic.Crest.Internal;
namespace WaveHarmonic.Crest.Editor
{
@@ -16,13 +13,8 @@ namespace WaveHarmonic.Crest.Editor
#endif
[DefaultExecutionOrder(-1000)]
[ExecuteAlways]
sealed class LightingPatcher : MonoBehaviour
sealed class LightingPatcher : CustomBehaviour
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
#if !CREST_DEBUG
[HideInInspector]
#endif
@@ -38,8 +30,10 @@ namespace WaveHarmonic.Crest.Editor
bool _CurrentLightsUseLinearIntensity;
bool _CurrentLightsUseColorTemperature;
void OnEnable()
private protected override void OnEnable()
{
base.OnEnable();
// SRP is always linear with temperature.
if (RenderPipelineHelper.IsLegacy)
{

View File

@@ -13,11 +13,6 @@ namespace WaveHarmonic.Crest.Editor
[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()
{

View File

@@ -16,11 +16,6 @@ namespace WaveHarmonic.Crest.Editor
[DefaultExecutionOrder(10)]
sealed class RenderPipelineLightPatcher : RenderPipelinePatcher
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
#if d_UnityHDRP
// For 2023.3 onwards, HDAdditionalLightData.intensity is obsolete and returns Light.intensity.
// It still serializes the old value so grab it via reflection.

View File

@@ -3,19 +3,18 @@
using UnityEngine;
using UnityEngine.Rendering;
#if UNITY_EDITOR
using MonoBehaviour = WaveHarmonic.Crest.Internal.EditorBehaviour;
#endif
using WaveHarmonic.Crest.Internal;
namespace WaveHarmonic.Crest.Editor
{
[ExecuteAlways]
abstract class RenderPipelinePatcher : MonoBehaviour
abstract class RenderPipelinePatcher : CustomBehaviour
{
#if UNITY_EDITOR
protected virtual void OnEnable()
private protected override void OnEnable()
{
base.OnEnable();
RenderPipelineManager.activeRenderPipelineTypeChanged -= OnActiveRenderPipelineTypeChanged;
RenderPipelineManager.activeRenderPipelineTypeChanged += OnActiveRenderPipelineTypeChanged;
}

View File

@@ -13,11 +13,6 @@ namespace WaveHarmonic.Crest.Editor
#endif
sealed class RenderPipelineSettingsPatcher : RenderPipelinePatcher
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
[@AttachMaterialEditor]
[@DecoratedField, SerializeField]
Material _SkyBox;
@@ -30,7 +25,7 @@ namespace WaveHarmonic.Crest.Editor
base.Reset();
}
protected override void OnEnable()
private protected override void OnEnable()
{
base.OnEnable();
OnActiveRenderPipelineTypeChanged();

View File

@@ -11,11 +11,6 @@ namespace WaveHarmonic.Crest.Editor
#endif
sealed class RenderPipelineTerrainPatcher : RenderPipelinePatcher
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
[SerializeField]
Material _Material;
@@ -26,7 +21,7 @@ namespace WaveHarmonic.Crest.Editor
Material _MaterialURP;
#if UNITY_EDITOR
protected override void OnEnable()
private protected override void OnEnable()
{
base.OnEnable();
OnActiveRenderPipelineTypeChanged();

View File

@@ -12,11 +12,6 @@ namespace WaveHarmonic.Crest.Editor
#endif
sealed class RevertPrefabOnRenderPipelineChange : RenderPipelinePatcher
{
[SerializeField, HideInInspector]
#pragma warning disable 414
int _Version = 0;
#pragma warning restore 414
#if UNITY_EDITOR
private protected override void Awake()
{