升级水插件

This commit is contained in:
2026-01-31 00:32:49 +08:00
parent a739d2fe3b
commit 4123e83573
293 changed files with 13449 additions and 2853 deletions

View File

@@ -428,6 +428,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
_Version: 0
_Source: 1
_Viewer: {fileID: 0}
_Layer: 0
_MinimumWavelength: 1
_DistanceFromSurfaceSigned: 0

View File

@@ -5,6 +5,7 @@ using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using WaveHarmonic.Crest.Internal.Compatibility;
namespace WaveHarmonic.Crest.Examples
{
@@ -21,7 +22,7 @@ namespace WaveHarmonic.Crest.Examples
#pragma warning restore 414
#if UNITY_EDITOR
static int s_Scene;
static ulong s_Scene;
static bool s_SceneChanged;
[InitializeOnLoadMethod]
@@ -29,16 +30,16 @@ namespace WaveHarmonic.Crest.Examples
{
EditorSceneManager.sceneClosed -= OnSceneClosed;
EditorSceneManager.sceneClosed += OnSceneClosed;
s_Scene = SceneManager.GetActiveScene().handle;
s_Scene = SceneManager.GetActiveScene().GetRawSceneHandle();
}
static void OnSceneClosed(Scene a)
{
// TODO: Report to Unity
// Does not work if only game view is open. Handles will never update.
if (s_Scene == a.handle) return;
if (s_Scene == a.GetRawSceneHandle()) return;
s_SceneChanged = true;
s_Scene = a.handle;
s_Scene = a.GetRawSceneHandle();
}
void OnEnable()

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5923ff6194bdd4740a68caa8ecad46d4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
// Crest Water System
// Copyright © 2024 Wave Harmonic. All rights reserved.
#if d_UnityInputSystem && ENABLE_INPUT_SYSTEM
#define INPUT_SYSTEM_ENABLED
#endif
using UnityEngine;
namespace WaveHarmonic.Crest.Examples
{
#if !CREST_DEBUG
[AddComponentMenu("")]
#endif
sealed class InputModulePatcher : MonoBehaviour
{
#if INPUT_SYSTEM_ENABLED
void OnEnable()
{
GetComponent<UnityEngine.EventSystems.StandaloneInputModule>().enabled = false;
}
#endif
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 539016482e955484bbeb4193a95d3e15
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -18,6 +18,9 @@ namespace WaveHarmonic.Crest.Examples
int _Version = 0;
#pragma warning restore 414
[SerializeField]
bool _WorldSpace;
[Header("Translation")]
[SerializeField]
@@ -52,7 +55,7 @@ namespace WaveHarmonic.Crest.Examples
void Start()
{
_Origin = transform.position;
_Origin = _WorldSpace ? transform.position : transform.localPosition;
_OrthogonalAxis = Quaternion.AngleAxis(90f, Vector3.up) * _Axis;
}
@@ -64,10 +67,21 @@ namespace WaveHarmonic.Crest.Examples
// Do circles in perlin noise
var rnd = 2f * (Mathf.PerlinNoise(0.5f + 0.5f * Mathf.Cos(_Frequency * Time.time), 0.5f + 0.5f * Mathf.Sin(_Frequency * Time.time)) - 0.5f);
// Prevent jump at start.
var amplitude = Mathf.Min(_Amplitude, _Amplitude * Time.timeSinceLevelLoad);
var orthoPhaseOff = Mathf.PI / 2f;
var rndOrtho = 2f * (Mathf.PerlinNoise(0.5f + 0.5f * Mathf.Cos(_Frequency * Time.time + orthoPhaseOff), 0.5f + 0.5f * Mathf.Sin(_Frequency * Time.time + orthoPhaseOff)) - 0.5f);
var position = _Origin + (_Axis * rnd + _OrthogonalMotion * rndOrtho * _OrthogonalAxis) * amplitude;
transform.position = _Origin + (_Axis * rnd + _OrthogonalMotion * rndOrtho * _OrthogonalAxis) * _Amplitude;
if (_WorldSpace)
{
transform.position = position;
}
else
{
transform.localPosition = position;
}
}
// Rotation

View File

@@ -34,6 +34,11 @@ namespace WaveHarmonic.Crest.Examples
return;
}
if (Helpers.IsWebGPU)
{
return;
}
_QuickVolumes.Clear();
foreach (var volume in GetComponents<PostProcessVolume>())

View File

@@ -96,6 +96,7 @@ MonoBehaviour:
- {fileID: 89624805562497374}
- {fileID: 7577113519358791614}
- {fileID: 4527986752527755293}
- {fileID: 1051598088582843543}
--- !u!114 &89624805562497374
MonoBehaviour:
m_ObjectHideFlags: 3
@@ -185,6 +186,52 @@ MonoBehaviour:
tint:
m_OverrideState: 0
m_Value: 0
--- !u!114 &1051598088582843543
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 24f077503be6ae942a1e1245dbd53ea9, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 1
quality:
m_OverrideState: 0
m_Value: 1
threshold:
m_OverrideState: 1
m_Value: 1
intensity:
m_OverrideState: 1
m_Value: 1
scatter:
m_OverrideState: 0
m_Value: 0.7
tint:
m_OverrideState: 0
m_Value: {r: 1, g: 1, b: 1, a: 1}
dirtTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
dirtIntensity:
m_OverrideState: 0
m_Value: 0
anamorphic:
m_OverrideState: 0
m_Value: 1
m_Resolution:
m_OverrideState: 0
m_Value: 2
m_HighQualityPrefiltering:
m_OverrideState: 0
m_Value: 0
m_HighQualityFiltering:
m_OverrideState: 0
m_Value: 1
--- !u!114 &1692474355597373712
MonoBehaviour:
m_ObjectHideFlags: 3

View File

@@ -62,6 +62,9 @@
},
{
"m_Id": "988d3fda4b75435b9f2630355731fbc7"
},
{
"m_Id": "5ab14e58fd6d47fc94208753d460c917"
}
],
"m_Keywords": [
@@ -318,6 +321,9 @@
},
{
"m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e"
},
{
"m_Id": "af669ec9501e494e8249b25fb552a4e6"
}
],
"m_GroupDatas": [
@@ -1050,6 +1056,20 @@
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "af669ec9501e494e8249b25fb552a4e6"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "3d920b053a2f4bbfaaf6ba4f8c9f137e"
},
"m_SlotId": -1490972
}
},
{
"m_OutputSlot": {
"m_Node": {
@@ -1407,6 +1427,9 @@
"m_ChildObjectList": [
{
"m_Id": "65d8361074904a08ba28f1116b517849"
},
{
"m_Id": "5ab14e58fd6d47fc94208753d460c917"
}
]
}
@@ -3630,6 +3653,21 @@
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "4a0bdf43d1d44b39b77034a01053b999",
"m_Id": 0,
"m_DisplayName": "Water Volume Multiplier",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.MultiplyNode",
@@ -4240,6 +4278,34 @@
}
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "5ab14e58fd6d47fc94208753d460c917",
"m_Guid": {
"m_GuidSerialized": "5da6eda6-901d-4429-a84c-4b0e0ef60ca6"
},
"m_Name": "Water Volume Multiplier",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Water Volume Multiplier",
"m_DefaultReferenceName": "_Water_Volume_Multiplier",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": 1.0,
"m_FloatType": 1,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
@@ -6991,6 +7057,42 @@
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "af669ec9501e494e8249b25fb552a4e6",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -732.5001220703125,
"y": 336.00006103515627,
"width": 199.5001220703125,
"height": 33.99993896484375
}
},
"m_Slots": [
{
"m_Id": "4a0bdf43d1d44b39b77034a01053b999"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "5ab14e58fd6d47fc94208753d460c917"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",