22 lines
535 B
C#
22 lines
535 B
C#
|
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);
|
||
|
}
|
||
|
}
|