25 lines
491 B
C#
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);
|
|
}
|
|
}
|