12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using UnityEngine;
- using UnityEngine.UI;
- using QFramework;
- using ChivaXR.Op;
- using DG.Tweening;
- namespace QFramework
- {
- public class ExamPanelData : UIPanelData
- {
- }
- public partial class ExamPanel : UIPanel
- {
-
- protected override void OnInit(IUIData uiData = null)
- {
- mData = uiData as ExamPanelData ?? new ExamPanelData();
- ExamManager.Instance.timeHandle += TimeHandle;
- ExamManager.Instance.deductionScoreHandle += DeductionScoreHandle;
- confirmBtn.onClick.AddListener(() =>
- {
- ExamFinishPopPanel.gameObject.SetActive(false);
- ScoreReportPanel.gameObject.SetActive(true);
- });
- }
- public void DeductionScoreHandle(ExamDataContainer examDataContainer)
- {
- ScoreReportPopText.text = (-examDataContainer.score).ToString();
- ScoreReportPopText.transform.DOScale(Vector3.one, 0.4f).OnComplete(() => ScoreReportPopText.transform.DOScale(Vector3.zero, 0.5f).SetDelay(1f));
- }
- public void TimeHandle(bool finish, string time)
- {
- Text.text = time;
- if (finish)
- {
- ExamFinishPopPanel.gameObject.SetActive(true);
- ScoreText.text = "考试成绩为:"+ ExamManager.Instance.ScoreSettlement();
- }
- }
- protected override void OnOpen(IUIData uiData = null)
- {
- }
-
- protected override void OnShow()
- {
- }
-
- protected override void OnHide()
- {
- }
-
- protected override void OnClose()
- {
- }
- }
- }
|