using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ChooseText : MonoBehaviour { public Color ncolor; public Color ccolor; private void Awake() { this.transform.parent.GetComponent().onValueChanged.AddListener((b)=>{ this.GetComponent().color = b?ccolor:ncolor; }); } }