33 lines
597 B
C#
33 lines
597 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BTN_OptionsWaterRipples : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Toggle toggle;
|
|
|
|
private RenderSettingsMy renderSettings;
|
|
|
|
private void OnEnable()
|
|
{
|
|
if (toggle == null)
|
|
{
|
|
toggle = GetComponent<Toggle>();
|
|
}
|
|
if ((bool)GlobalSettings.Instance)
|
|
{
|
|
renderSettings = GlobalSettings.Instance.renderSettings;
|
|
toggle.isOn = renderSettings.useWaterRipples;
|
|
}
|
|
}
|
|
|
|
public void ValueChanged()
|
|
{
|
|
if ((bool)renderSettings)
|
|
{
|
|
renderSettings.useWaterRipples = toggle.isOn;
|
|
renderSettings.RefreshWaterRipples();
|
|
}
|
|
}
|
|
}
|