SelectItem.cs 553 B

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. namespace AppUI.Util.Group
  7. {
  8. public class SelectItem : MonoBehaviour
  9. {
  10. [SerializeField] TMP_Text text;
  11. [SerializeField] Image switcher;
  12. public void SetData(string content, bool selected)
  13. {
  14. text.text = content;
  15. switcher.enabled = selected;
  16. text.color = selected
  17. ? Color.black
  18. : new Color(0.37f, 0.37f, 0.37f);
  19. }
  20. }
  21. }