1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using TMPro;
- using static LangChaoJiekou;
- using UnityEngine.UI;
- using XRTool.Util;
- public class XunJianDefault : MonoBehaviour
- {
-
- public Button noBtn;
- public Button yesBtn;
- public GameObject hintUI;
- public TMP_Text hintText;
- private bool isGetData;
- private void Start()
- {
- isGetData = false;
- noBtn.onClick.AddListener(() => { gameObject.SetActive(false); });
- yesBtn.onClick.AddListener(() => {
-
- if(isGetData)
- {
- // 进入巡检
- ScenesManager.Instance.showWindow(ScenesManager.SceneType.ShowXunJian);
- hintUI.SetActive(false);
- gameObject.SetActive(false);
- }
- else if(!string.IsNullOrEmpty(hintText.text))
- {
- HintShow();
- }
- else
- {
- // 获取数据的回调未完成 等待完成
- return;
- }
- });
-
- }
- private void OnEnable()
- {
- hintUI.SetActive(false);
- if (XunJianAllData.taskItem == null)
- XunJianDataManager.Instance.checkXunjian((msg) =>
- {
- hintText.text = msg;
- isGetData = string.IsNullOrEmpty(msg);
- });
- }
-
- private void HintShow()
- {
- hintUI.gameObject.SetActive(true);
- TimerMgr.Instance.CreateTimer(() =>
- {
- hintUI.gameObject.SetActive(false);
-
- }, 3);
- gameObject.SetActive(false);
- }
- }
|