还原水插件
This commit is contained in:
@@ -5,7 +5,6 @@ using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using WaveHarmonic.Crest.Internal.Compatibility;
|
||||
|
||||
namespace WaveHarmonic.Crest.Examples
|
||||
{
|
||||
@@ -22,7 +21,7 @@ namespace WaveHarmonic.Crest.Examples
|
||||
#pragma warning restore 414
|
||||
|
||||
#if UNITY_EDITOR
|
||||
static ulong s_Scene;
|
||||
static int s_Scene;
|
||||
static bool s_SceneChanged;
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
@@ -30,16 +29,16 @@ namespace WaveHarmonic.Crest.Examples
|
||||
{
|
||||
EditorSceneManager.sceneClosed -= OnSceneClosed;
|
||||
EditorSceneManager.sceneClosed += OnSceneClosed;
|
||||
s_Scene = SceneManager.GetActiveScene().GetRawSceneHandle();
|
||||
s_Scene = SceneManager.GetActiveScene().handle;
|
||||
}
|
||||
|
||||
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.GetRawSceneHandle()) return;
|
||||
if (s_Scene == a.handle) return;
|
||||
s_SceneChanged = true;
|
||||
s_Scene = a.GetRawSceneHandle();
|
||||
s_Scene = a.handle;
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5923ff6194bdd4740a68caa8ecad46d4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,24 +0,0 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 539016482e955484bbeb4193a95d3e15
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -18,9 +18,6 @@ namespace WaveHarmonic.Crest.Examples
|
||||
int _Version = 0;
|
||||
#pragma warning restore 414
|
||||
|
||||
[SerializeField]
|
||||
bool _WorldSpace;
|
||||
|
||||
[Header("Translation")]
|
||||
|
||||
[SerializeField]
|
||||
@@ -55,7 +52,7 @@ namespace WaveHarmonic.Crest.Examples
|
||||
|
||||
void Start()
|
||||
{
|
||||
_Origin = _WorldSpace ? transform.position : transform.localPosition;
|
||||
_Origin = transform.position;
|
||||
|
||||
_OrthogonalAxis = Quaternion.AngleAxis(90f, Vector3.up) * _Axis;
|
||||
}
|
||||
@@ -67,21 +64,10 @@ 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;
|
||||
|
||||
if (_WorldSpace)
|
||||
{
|
||||
transform.position = position;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.localPosition = position;
|
||||
}
|
||||
transform.position = _Origin + (_Axis * rnd + _OrthogonalMotion * rndOrtho * _OrthogonalAxis) * _Amplitude;
|
||||
}
|
||||
|
||||
// Rotation
|
||||
|
||||
@@ -34,11 +34,6 @@ namespace WaveHarmonic.Crest.Examples
|
||||
return;
|
||||
}
|
||||
|
||||
if (Helpers.IsWebGPU)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_QuickVolumes.Clear();
|
||||
|
||||
foreach (var volume in GetComponents<PostProcessVolume>())
|
||||
|
||||
Reference in New Issue
Block a user