using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; /// /// toggle相关的状态管理 /// public class MyToggleState : MonoBehaviour { public TextMeshProUGUI myName; public TextMeshProUGUI myTime; public TextMeshProUGUI myEvent; Toggle t; // Start is called before the first frame update void Start() { t=GetComponent(); } public void OnToggleChange(bool value) { if (value) { myName.color = Color.black; myTime.color = Color.black; } else { myName.color = Color.white; myTime.color = Color.white; } } }