using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class DropDownItem : MonoBehaviour { public Toggle m_toggle; // Sprite m_SelectSprite; // Sprite m_defaultSprite; public GameObject itemBackGround; // Start is called before the first frame update void Start() { // m_SelectSprite = Resources.Load("Prefabs/RobotUI/选中列表"); if (m_toggle.isOn == true) { itemBackGround.SetActive(true); } // m_defaultSprite = Resources.Load("Prefabs/RobotUI/矩形 1277"); //m_toggle.onValueChanged.AddListener((x) => //{ // if (x) // { // itemBackGround.GetComponent().sprite= m_SelectSprite; // } // //else // //{ // // itemBackGround.GetComponent().sprite = m_defaultSprite; // //} //}); } // Update is called once per frame void Update() { } }