FaultPanel_Item.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using TMPro;
  4. namespace GHZLangChao
  5. {
  6. /// <summary>
  7. /// ShowDaoHang 面板 -- 故障面板 ---子物体
  8. /// </summary>
  9. public class FaultPanel_Item : AbstractController
  10. {
  11. public TextMeshProUGUI Name; // 设备名称
  12. public TextMeshProUGUI System; // 承载系统
  13. public TextMeshProUGUI Level; // 告警级别
  14. public TextMeshProUGUI Time;// 告警时间
  15. private AlarmData AlarmData;
  16. public void Init(AlarmData AlarmData)
  17. {
  18. this.AlarmData = AlarmData;
  19. Name.text = AlarmData.title;
  20. System.text = AlarmData.carryingSystem;
  21. Level.text = AlarmData.level;
  22. Time.text = AlarmData.equipmentAlarmTime;
  23. }
  24. private Color mButtonColor = new Color(102,178,255,128);
  25. public void ClickButton()
  26. {
  27. Debug.Log($"选择了{name}");
  28. GetComponent<RawImage>().color = mButtonColor;
  29. XunJianManager.AlarmData = AlarmData;
  30. BasicDeviceControl.AlarmData = AlarmData;
  31. }
  32. }
  33. }