using CG.Framework; using CG.UTility; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace ZXK.GYJQR { public class AZBSExamPanel : UIBase { private Transform _erroTipTran = null; private Text _tipText = null; protected override void Awake() { base.Awake(); _tipText = GetWedage("TipText_N").GetComponent(); _erroTipTran = GetWedage("ErroTip_N").transform; //顶部设置 UI_Manage.Instance.ShowPanel("OperationTopPanel", Type.GetType("ZXK.GYJQR.OperationTopPanel"), UIGroup.Top); StartCoroutine("LoadFirst"); } private void OnEnable() { GameManager.Instance._DataAZBSHandler.CurAZBShandler.OnValueChanged+= OnDismountStepChanged; } private void OnDisable() { GameManager.Instance._DataAZBSHandler.CurAZBShandler.OnValueChanged -= OnDismountStepChanged; } private IEnumerator LoadFirst() { yield return new WaitForSeconds(0.02f); OnSwitchStep(); } private void OnDismountStepChanged(AZBS obj) { string curShowGeo = GameManager.Instance._DataAZBSHandler.CurAZBShandler.Value.stepName; _tipText.text = obj.stepName; } /// /// 切换下一个步骤 /// public void OnSwitchStep() { foreach (AZBS item in GameManager.Instance._DataAZBSHandler.AZBSDataArray) { if (item.stepName.Equals("连接驱动电缆")) { GameManager.Instance._DataAZBSHandler.CurAZBShandler.Value = item; StepManager.Instance.OnExcuteAZBS(ExcuteState.Excute); } } } /// /// 考核模式操作错误提示 /// /// 提示内容 /// 停留时间 public void ErroTipShow(string tipTxt) { _erroTipTran.Find("ErroTipText").GetComponent().text = tipTxt; _erroTipTran.gameObject.SetActive(true); StartCoroutine("HideTip", 1); } private IEnumerator HideTip(float time) { yield return new WaitForSeconds(time); _erroTipTran.gameObject.SetActive(false); } } }