103 lines
2.0 KiB
C#
103 lines
2.0 KiB
C#
using UnityEngine;
|
|
|
|
public class FishingWaterSystem : MonoBehaviour
|
|
{
|
|
public enum WaterSystemType
|
|
{
|
|
KWS = 0,
|
|
Crest = 1
|
|
}
|
|
|
|
[SerializeField]
|
|
private WaterParameters _waterParametersNormal;
|
|
|
|
[SerializeField]
|
|
private WaterParameters _waterParametersWinter;
|
|
|
|
[SerializeField]
|
|
private KWSWaterSystem _kwsWaterSystem;
|
|
|
|
[SerializeField]
|
|
private CrestWaterSystem _crestWaterSystem;
|
|
|
|
[SerializeField]
|
|
private WaterSystemType _waterSystemType = WaterSystemType.Crest;
|
|
|
|
[SerializeField]
|
|
private float _windSpeedMin = 0.5f;
|
|
|
|
[SerializeField]
|
|
private float _windSpeedMax = 1.25f;
|
|
|
|
private WaterSystemBase _waterSystem;
|
|
|
|
public static WaterSystemType waterSystemType = WaterSystemType.Crest;
|
|
|
|
public void Initialize()
|
|
{
|
|
waterSystemType = _waterSystemType;
|
|
_kwsWaterSystem.gameObject.SetActive(false);
|
|
_crestWaterSystem.gameObject.SetActive(false);
|
|
switch (_waterSystemType)
|
|
{
|
|
case WaterSystemType.KWS:
|
|
_waterSystem = _kwsWaterSystem;
|
|
break;
|
|
case WaterSystemType.Crest:
|
|
_waterSystem = _crestWaterSystem;
|
|
break;
|
|
}
|
|
_waterSystem.gameObject.SetActive(true);
|
|
_waterSystem.Initialize();
|
|
}
|
|
|
|
public void SetRainIntensity(float ratio)
|
|
{
|
|
_waterSystem.SetRainIntensity(ratio);
|
|
}
|
|
|
|
public void SetWindDirection(float angle)
|
|
{
|
|
_waterSystem.SetWindDirection(angle);
|
|
}
|
|
|
|
public void UpdateWindDirection(float angle)
|
|
{
|
|
_waterSystem.UpdateWindDirection(angle);
|
|
}
|
|
|
|
public void SetWindStrength(float ratio)
|
|
{
|
|
_waterSystem.SetWindStrength(ratio);
|
|
}
|
|
|
|
public void UpdateWindStrength(float ratio)
|
|
{
|
|
_waterSystem.UpdateWindStrength(ratio);
|
|
}
|
|
|
|
public void SetWaterRipples(bool use)
|
|
{
|
|
_waterSystem.SetWaterRipples(use);
|
|
}
|
|
|
|
public void SetQuality(RenderSettingsMy.RenderQuality quality)
|
|
{
|
|
_waterSystem.SetQuality(quality);
|
|
}
|
|
|
|
public void SetReflectionQuality(RenderSettingsMy.ReflectionQuality quality)
|
|
{
|
|
_waterSystem.SetReflectionQuality(quality);
|
|
}
|
|
|
|
public WaterParameters GetWaterParameters(bool isWinter)
|
|
{
|
|
if (isWinter)
|
|
{
|
|
return _waterParametersWinter;
|
|
}
|
|
return _waterParametersNormal;
|
|
}
|
|
}
|