22 lines
535 B
C#
Raw Permalink Normal View History

2025-06-07 17:43:34 +08:00
using UnityEngine;
using UnityEngine.UI;
[RequireComponent(typeof(Toggle))]
public class DropDownutils : MonoBehaviour
{
Toggle toggle;
// Start is called before the first frame update
void Start()
{
toggle = this.GetComponent<Toggle>();
}
// Update is called once per frame
void Update()
{
if (toggle == null)
return;
this.transform.Find("Item Label").GetComponent<Text>().color = toggle.isOn ? new Color32(0, 0, 0, 255) : new Color32(182, 152, 104, 255);
}
}