using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using System; public class UI_PracticeCompletedPanel : BasePanel { public UI_PracticeInfoItem piiPrefab; public RectTransform content; public void Init() { ScoreModel scoreModel = ScoreManager.instance.GetScore(GameManager.RunModelMgr.schemeID); for (int i = 0; i < scoreModel.pointList.Count; i++) { int index = i; UI_PracticeInfoItem temp = Instantiate(piiPrefab, content); temp.Init(index, scoreModel.pointList[index]); } GetControl("ScoreRes").text = scoreModel.score.ToString(); GetControl("UsedTimesRes").text = (DateTime.Now - GameManager.RunModelMgr.startTime).ToString(@"hh\:mm\:ss"); Debug.Log("开始时间:" + GameManager.RunModelMgr.startTime.ToString() + " 结束时间:" + DateTime.Now.ToString()); } protected override void OnClick(string btnName) { switch (btnName) { case "restartBtn": GameManager.Instance.Practice(); break; case "backBtn": GameManager.Instance.ShowUIPanelAndLoadScene(true); break; case "closeBtn": break; default: break; } GameManager.UIMgr.HidePanel(); } }