SearchPanel_Item.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using TMPro;
  4. namespace GHZLangChao
  5. {
  6. /// <summary>
  7. /// ShowDaoHang 面板 -- 搜索面板 ---子物体
  8. /// </summary>
  9. public class SearchPanel_Item : MonoBehaviour
  10. {
  11. public TextMeshProUGUI Name; // 设备名称
  12. public TextMeshProUGUI System; // 承载系统
  13. public TextMeshProUGUI Pos; // 设备位置
  14. public TextMeshProUGUI Type;// 设备类别
  15. public TextMeshProUGUI Model;// 设备型号
  16. public TextMeshProUGUI Factory;// 厂家
  17. public TextMeshProUGUI Standards;// 规格
  18. private MachineParameters MachineParameter;
  19. public void Init(MachineParameters MachineParameter)
  20. {
  21. this.MachineParameter = MachineParameter;
  22. Name.text = MachineParameter.deviceName;
  23. System.text = MachineParameter.carryingSystem;
  24. Pos.text = MachineParameter.deviceLocation;
  25. Type.text = MachineParameter.equipmentType;
  26. if(MachineParameter.equipmentModel!=null)
  27. Model.text = MachineParameter.equipmentModel;
  28. else
  29. Model.text = "--";
  30. if(MachineParameter.factory!=null)
  31. Factory.text = MachineParameter.factory;
  32. else
  33. Factory.text = "--";
  34. if(MachineParameter.specification!=null)
  35. Standards.text = MachineParameter.specification;
  36. else
  37. Standards.text = "--";
  38. }
  39. private Color mButtonColor = new Color(102,178,255,128);
  40. public void ClickButton()
  41. {
  42. Debug.Log($"选择了{name}");
  43. GetComponent<RawImage>().color = mButtonColor;
  44. XunJianManager.MachineParameters = MachineParameter;
  45. }
  46. }
  47. }