升级6.4.升级水,升级天气
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// Copyright © 2024 Wave Harmonic. All rights reserved.
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using WaveHarmonic.Crest.Internal;
|
||||
|
||||
namespace WaveHarmonic.Crest.Examples
|
||||
@@ -11,20 +12,20 @@ namespace WaveHarmonic.Crest.Examples
|
||||
[AddComponentMenu(Constants.k_MenuPrefixSample + "Ripple Generator")]
|
||||
sealed class RippleGenerator : ManagedBehaviour<WaterRenderer>
|
||||
{
|
||||
[SerializeField, HideInInspector]
|
||||
#pragma warning disable 414
|
||||
int _Version = 0;
|
||||
#pragma warning restore 414
|
||||
|
||||
[Tooltip("Amount of time before it starts.")]
|
||||
[FormerlySerializedAs("_WarmUp")]
|
||||
[SerializeField]
|
||||
float _WarmUp = 3f;
|
||||
|
||||
[SerializeField]
|
||||
float _OnTime = 0.2f;
|
||||
float _StartTime = 3f;
|
||||
|
||||
[Tooltip("The time interval to inject a ripple.\n\nTime will loop around by this number (in seconds). Increase to make ripples more frequent.")]
|
||||
[SerializeField]
|
||||
float _Period = 4f;
|
||||
|
||||
[Tooltip("The length of time in the period the input runs for.\n\nFrom the start of the period until this time, the input will continue to render. The longer it is active, the further the water will be pushed/pulled per period. If it is too long for the period, the surface may never return to rest.")]
|
||||
[FormerlySerializedAs("_OnTime")]
|
||||
[SerializeField]
|
||||
float _Length = 0.2f;
|
||||
|
||||
DynamicWavesLodInput _DynamicWavesLodInput;
|
||||
|
||||
private protected override void Initialize()
|
||||
@@ -44,15 +45,15 @@ namespace WaveHarmonic.Crest.Examples
|
||||
|
||||
var time = water.CurrentTime;
|
||||
|
||||
if (time < _WarmUp)
|
||||
if (time < _StartTime)
|
||||
{
|
||||
_DynamicWavesLodInput.ForceRenderingOff = true;
|
||||
return;
|
||||
}
|
||||
|
||||
time -= _WarmUp;
|
||||
time -= _StartTime;
|
||||
time = Mathf.Repeat(time, _Period);
|
||||
_DynamicWavesLodInput.ForceRenderingOff = time >= _OnTime;
|
||||
_DynamicWavesLodInput.ForceRenderingOff = time >= _Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user