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

33 lines
569 B
C#

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