using UnityEngine; using UnityEngine.UI; public class WinterToggle : MonoBehaviour { private Toggle toggle; public Text text; private void OnEnable() { toggle = GetComponent(); 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); } }