79 lines
1.4 KiB
C#
79 lines
1.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
namespace UltimateWater
|
|
{
|
|
[Serializable]
|
|
public struct NormalMapAnimation
|
|
{
|
|
[FormerlySerializedAs("speed")]
|
|
[SerializeField]
|
|
private float _Speed;
|
|
|
|
[Tooltip("Angular deviation from the wind direction.")]
|
|
[SerializeField]
|
|
[FormerlySerializedAs("deviation")]
|
|
private float _Deviation;
|
|
|
|
[Range(0f, 4f)]
|
|
[FormerlySerializedAs("intensity")]
|
|
[SerializeField]
|
|
private float _Intensity;
|
|
|
|
[FormerlySerializedAs("tiling")]
|
|
[SerializeField]
|
|
private Vector2 _Tiling;
|
|
|
|
public float Speed
|
|
{
|
|
get
|
|
{
|
|
return _Speed;
|
|
}
|
|
}
|
|
|
|
public float Deviation
|
|
{
|
|
get
|
|
{
|
|
return _Deviation;
|
|
}
|
|
}
|
|
|
|
public float Intensity
|
|
{
|
|
get
|
|
{
|
|
return _Intensity;
|
|
}
|
|
}
|
|
|
|
public Vector2 Tiling
|
|
{
|
|
get
|
|
{
|
|
return _Tiling;
|
|
}
|
|
}
|
|
|
|
public NormalMapAnimation(float speed, float deviation, float intensity, Vector2 tiling)
|
|
{
|
|
_Speed = speed;
|
|
_Deviation = deviation;
|
|
_Intensity = intensity;
|
|
_Tiling = tiling;
|
|
}
|
|
|
|
public static NormalMapAnimation operator *(NormalMapAnimation a, float w)
|
|
{
|
|
return new NormalMapAnimation(a._Speed * w, a._Deviation * w, a._Intensity * w, a._Tiling * w);
|
|
}
|
|
|
|
public static NormalMapAnimation operator +(NormalMapAnimation a, NormalMapAnimation b)
|
|
{
|
|
return new NormalMapAnimation(a._Speed + b._Speed, a._Deviation + b._Deviation, a._Intensity + b._Intensity, a._Tiling + b._Tiling);
|
|
}
|
|
}
|
|
}
|