/**************************************************************************** * 2023.10 DESKTOP-DL7CJI0 ****************************************************************************/ using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using QFramework; using UnityEditor; using ChivaXR; using System.Collections; namespace QFramework { public partial class ExamInfo : UIElement { private void Awake() { //SubmitBtn.onClick.AddListener(() => //{ // UIKit.GetPanel().SubmitResult.gameObject.SetActive(true); //}); //ExamHelpBtn.onClick.AddListener(ExamHelpBtnClick); } /// /// ¿¼ÊÔÓÃʱ /// /// public void SetExamTime(int time) { TimeSpan ts = new TimeSpan(0, 0, Convert.ToInt32(time)); string str = ""; if (ts.Hours > 0) { str = String.Format("{0:00}", ts.Hours) + ":" + String.Format("{0:00}", ts.Minutes) + ":" + String.Format("{0:00}", ts.Seconds); } if (ts.Hours == 0 && ts.Minutes > 0) { str = "00:" + String.Format("{0:00}", ts.Minutes) + ":" + String.Format("{0:00}", ts.Seconds); } if (ts.Hours == 0 && ts.Minutes == 0) { str = "00:00:" + String.Format("{0:00}", ts.Seconds); } ExamTime.text = str; } protected override void OnBeforeDestroy() { } public void ShowWrongInfo(string info) { StopAllCoroutines(); WrongInfo.text = ""; StartCoroutine(WaitShowWrongInfo(info)); } IEnumerator WaitShowWrongInfo(string info) { ErrorInfoTitle.gameObject.SetActive(true); WrongInfo.text = info; ErrorInfoTitle.rectTransform.sizeDelta = new Vector2(WrongInfo.rectTransform.sizeDelta.x + 100, ErrorInfoTitle.rectTransform.sizeDelta.y); yield return new WaitForSeconds(2); ErrorInfoTitle.gameObject.SetActive(false); } private void ExamHelpBtnClick() { OperateSetting.Instance.ToolPackUILogic.SetHint(true); ExamManagerForPC.instance.RecordFault(ProcessManagement.Instance.currentStepID,ErrorReason.SelectWrongTarget); } } }