1234567891011121314151617 |
- 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<Toggle>().onValueChanged.AddListener((b)=>{
- this.GetComponent<Text>().color = b?ccolor:ncolor;
- });
- }
- }
|