JiLuItem.cs 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using static Manager;
  6. public class JiLuItem : MonoBehaviour
  7. {
  8. public Text lv;
  9. public Text time;
  10. public Text dev;
  11. public Text type;
  12. public void setData(GaoJingItemData data)
  13. {
  14. lv.text = data.lv;
  15. time.text = data.time;
  16. dev.text = data.dev;
  17. type.text = data.type;
  18. switch (lv.text)
  19. {
  20. case "一般":
  21. lv.color = Color.green;
  22. break;
  23. case "严重":
  24. lv.color = Color.red;
  25. break;
  26. case "紧急":
  27. lv.color = Color.yellow;
  28. break;
  29. }
  30. switch (type.text)
  31. {
  32. case "待解决":
  33. type.color = Color.red;
  34. break;
  35. case "已解决":
  36. type.color = Color.green;
  37. break;
  38. }
  39. }
  40. }