123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using DG.Tweening;
- using CCS.App;
- public class InspectList_Button : MonoBehaviour
- {
- public TextMesh text_num, text_name, text_isOk;
- public Material material_Undetected, material_To_be_tested, material_qualified, material_Unqualified;
- public int status;//状态
- public int jiluStaatus;
- public bool isChange;//是否在修改状态下
- public string content;
- public string mainSubtasks;//标题
- public string endResultViewPos;//生成结算面板 的结束位置
- public int viewTag;//标签 1 2 用来判断 该条用语音还是 扫码 1扫码 二 语音
- public string code;//料号
- public StartInspect startInspect = StartInspect.Undetected;
- public void OnSelect(bool isSelect)
- {
- Debug.Log("选择了"+ isSelect);
- if (isSelect)
- {
- this.GetComponent<MeshRenderer>().material = material_To_be_tested;
- text_isOk.text = "待结测";
- }
- else
- {
- SetBtnState();
- }
- }
- //void Update()
- //{
- // switch (status)
- // {
- // case 0://未检测
- // startInspect = StartInspect.Undetected;
- // break;
- // case 1://待检测
- // startInspect = StartInspect.To_be_tested;
- // break;
- // case 2://合格
- // startInspect = StartInspect.qualified;
- // break;
- // case 3://不合格
- // startInspect = StartInspect.Unqualified;
- // break;
- // }
- // if (startInspect == StartInspect.Undetected)
- // {
- // this.GetComponent<MeshRenderer>().material = material_Undetected;
- // text_isOk.text = "未检测";
- // }
- // else if (startInspect == StartInspect.To_be_tested)
- // {
- // this.GetComponent<MeshRenderer>().material = material_To_be_tested;
- // text_isOk.text = "待结测";
- // }
- // else if (startInspect == StartInspect.qualified)
- // {
- // this.GetComponent<MeshRenderer>().material = material_qualified;
- // text_isOk.text = "合格";
- // }
- // else if (startInspect == StartInspect.Unqualified)
- // {
- // this.GetComponent<MeshRenderer>().material = material_Unqualified;
- // text_isOk.text = "不合格";
- // }
- //}
- void OnEnable()
- {
- SetBtnState();
- //switch (status)
- //{
- // case 0://未检测
- // startInspect = StartInspect.Undetected;
- // break;
- // case 1://待检测
- // startInspect = StartInspect.To_be_tested;
- // break;
- // case 2://合格
- // startInspect = StartInspect.qualified;
- // break;
- // case 3://不合格
- // startInspect = StartInspect.Unqualified;
- // break;
- //}
- //if (startInspect == StartInspect.Undetected)
- //{
- // this.GetComponent<MeshRenderer>().material = material_Undetected;
- // text_isOk.text = "未检测";
- //}
- //else if (startInspect == StartInspect.To_be_tested)
- //{
- // this.GetComponent<MeshRenderer>().material = material_To_be_tested;
- // text_isOk.text = "待结测";
- //}
- //else if (startInspect == StartInspect.qualified)
- //{
- // this.GetComponent<MeshRenderer>().material = material_qualified;
- // text_isOk.text = "合格";
- //}
- //else if (startInspect == StartInspect.Unqualified)
- //{
- // this.GetComponent<MeshRenderer>().material = material_Unqualified;
- // text_isOk.text = "不合格";
- //}
- }
- public void SetBtnState()
- {
- switch (startInspect)
- {
- case StartInspect.Undetected:
- this.GetComponent<MeshRenderer>().material = material_Undetected;
- text_isOk.text = "未检测";
- break;
- case StartInspect.To_be_tested:
-
- break;
- case StartInspect.qualified:
- this.GetComponent<MeshRenderer>().material = material_qualified;
- text_isOk.text = "合格";
- break;
- case StartInspect.Unqualified:
- this.GetComponent<MeshRenderer>().material = material_Unqualified;
- text_isOk.text = "不合格";
- break;
- default:
- break;
- }
- }
- }
|