using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ExitCheckController : MonoBehaviour { public GameObject ExitCheckPanel; public Button QDButton; public Button QXButton; public Text text_sub; public int num_click; public Toggle AbnormalRecords; public GameObject toEcitCheckPanel; // 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); }); toEcitCheckPanel.SetActive(false); } public void ResetPlane() { switch (num_click) { case 0: text_sub.text = "是否确认退出检查!!!"; break; case 1: text_sub.text = "结束检查后无法重回现场检查,请填写纸质通知单及处理单。"; break; case 2: ExitCheckPanel.SetActive(false); AbnormalRecords.isOn = true; AbnormalRecords.onValueChanged.Invoke(true); toEcitCheckPanel.SetActive(true); break; } } }