Files
2026-02-21 16:45:37 +08:00

25 lines
491 B
C#

using UnityEngine;
using UnityEngine.UI;
public class WinterToggle : MonoBehaviour
{
private Toggle toggle;
public Text text;
private void OnEnable()
{
toggle = GetComponent<Toggle>();
UpdateValue();
}
public void UpdateValue()
{
if ((bool)GlobalSettings.Instance)
{
GlobalSettings.Instance.weatherSettings.isWinter = toggle.isOn;
}
text.color = new Color(text.color.r, text.color.g, text.color.b, (!toggle.interactable) ? toggle.colors.disabledColor.a : 1f);
}
}