SPJK_ObsItem.cs 786 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class SPJK_ObsItem : MonoBehaviour
  6. {
  7. public ObsData _data;
  8. public Text nameText;
  9. public Text typeText;
  10. public Text codeText;
  11. public Text updataTimeText;
  12. public void SetData(ObsData data)
  13. {
  14. _data = data;
  15. nameText.text = _data.name;
  16. switch (_data.type)
  17. {
  18. case obsType.BuYuanObs:
  19. typeText.text = "分类:<color=#FFFFFF>补元</color>";
  20. break;
  21. case obsType.TaoKouObs:
  22. typeText.text = "分类:<color=#FFFFFF>套口</color>";
  23. break;
  24. }
  25. codeText.text = $"编码:<color=#FFFFFF>{_data.deviceId}</color>";;
  26. }
  27. }