using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; using Utility; public class ExitCheckController : MonoBehaviour { public GameObject ExitCheckPanel; public GameObject End; public Button QDButton; public Button QXButton; public Text text_sub; public int num_click; public string endTime; // Start is called before the first frame update void Start() { num_click = 0; QDButton.onClick.AddListener(() => { num_click++; ResetPlane(); }); QXButton.onClick.AddListener(() => { num_click = 0; ExitCheckPanel.SetActive(false); }); UIManager.Instance.time.timeOver.AddListener((s) => { num_click = 2; endTime = s; ResetPlane(); }); } public void ResetPlane() { switch (num_click) { case 0: text_sub.text = "是否确认退出检查!!!"; break; case 1: text_sub.text = "结束检查后无法重回现场检查,是否确定。"; break; case 2: foreach (Toggle item in UIManager.Instance.bottomCotroller.toggles) { item.isOn = false; item.gameObject.SetActive(false); if (item.name == "异常记录") { item.gameObject.SetActive(true); item.isOn = true; } } WaitUpScore(); UIManager.Instance.bottomCotroller.BirdEyeView.gameObject.SetActive(false); UIManager.Instance.bottomCotroller.updownLadder.gameObject.SetActive(false); End.SetActive(true); ExitCheckPanel.SetActive(false); CurrentExamPaperDetails cepd = new CurrentExamPaperDetails(); cepd.userInfo = GlobalFlag.userName; cepd.useTime = UIManager.Instance.time.countTime.ToString(); cepd.examPaperDetails = FractionManager.Instance.examPaperDetails; ToolUtility.WriteToLocal("AnswerRecord", cepd); break; } } private void WaitUpScore() { int jobCardScore = UIManager.Instance.jobCardController.AddScore(); List stepPoint = UIManager.Instance.jobCardController.stepInfo; FractionManager.Instance.CheckWriteOders(jobCardScore, stepPoint); string abnormalRecord = UIManager.Instance.bottomCotroller.panels[2].GetComponentInChildren().text; FractionManager.Instance.CheckAbnormalRecords(abnormalRecord); } }