54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using UnityEngine;
|
|
|
|
namespace UltimateWater
|
|
{
|
|
public class WaterRipplesProfile : ScriptableObject
|
|
{
|
|
[Tooltip("How fast wave amplitude decreases with time")]
|
|
[Range(0f, 1f)]
|
|
[Header("Settings")]
|
|
public float Damping = 0.3f;
|
|
|
|
[Tooltip("How fast the waves spread")]
|
|
[Range(0f, 1f)]
|
|
public float Propagation = 1f;
|
|
|
|
[Tooltip("Force inflicted by interacting objects")]
|
|
public float Gain = 30f;
|
|
|
|
[Tooltip("Wave amplitude decrease with depth")]
|
|
public float HeightGain = 2f;
|
|
|
|
[Tooltip("Wave amplitude decrease offset")]
|
|
public float HeightOffset = 2f;
|
|
|
|
[Tooltip("Wave height multiplier")]
|
|
public float Amplitude = 1f;
|
|
|
|
[Tooltip("How much smoothing is applied between iterations")]
|
|
[Range(0f, 1f)]
|
|
[Header("Smooth")]
|
|
public float Sigma;
|
|
|
|
[Tooltip("How strong are wave normals")]
|
|
[Header("Normals")]
|
|
public float Multiplier = 1f;
|
|
|
|
[Tooltip("How wide is sampling distance for normal calculations")]
|
|
public float Spread = 0.001f;
|
|
|
|
private void OnValidate()
|
|
{
|
|
if (Application.isPlaying)
|
|
{
|
|
WaterSimulationArea[] array = Object.FindObjectsOfType<WaterSimulationArea>();
|
|
WaterSimulationArea[] array2 = array;
|
|
foreach (WaterSimulationArea waterSimulationArea in array2)
|
|
{
|
|
waterSimulationArea.UpdateShaderVariables();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|