inspectResultList_Button.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using CCS.App;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class inspectResultList_Button : MonoBehaviour
  6. {
  7. // Use this for initialization
  8. public TextMesh text_id; //序列号
  9. public TextMesh text_Tag;//标题内容
  10. public TextMesh text_status;//状态
  11. public int tatus;
  12. private Color gray;//0 灰色
  13. private Color yellow;//1 黄色
  14. private Color green;//2 绿色
  15. private Color red;//3 红色
  16. void Start()
  17. {
  18. yellow = new Color(255f, 183 / 255f, 0);
  19. green = new Color(183 / 255f, 210 / 255f, 0);
  20. red = new Color(1f, 0f, 0f);
  21. }
  22. public void SetText_ID(string txt)
  23. {
  24. text_id.text = txt;
  25. }
  26. public void SetText_Tag(string txt)
  27. {
  28. text_Tag.text = txt;
  29. }
  30. public void SetText_Status(StartInspect startInspect)
  31. {
  32. switch (startInspect)
  33. {
  34. case StartInspect.Undetected:
  35. text_status.text = "未检测";
  36. text_status.color = Color.gray;
  37. break;
  38. case StartInspect.To_be_tested:
  39. break;
  40. case StartInspect.qualified:
  41. text_status.text = "合格";
  42. text_status.color = Color.green;
  43. break;
  44. case StartInspect.Unqualified:
  45. text_status.text = "不合格";
  46. text_status.color = Color.red;
  47. break;
  48. default:
  49. break;
  50. }
  51. }
  52. }