Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/BTN_OptionsUnderwaterDistortion.cs
2026-02-21 16:45:37 +08:00

32 lines
574 B
C#

using UnityEngine;
using UnityEngine.UI;
public class BTN_OptionsUnderwaterDistortion : 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.underwaterDistortion;
}
}
public void ValueChanged()
{
if ((bool)renderSettings)
{
renderSettings.underwaterDistortion = toggle.isOn;
}
}
}