From 066c238fea15f37a95af50888ac554e50f788dea Mon Sep 17 00:00:00 2001
From: YangHua <1475658476@qq.com>
Date: Tue, 3 Sep 2024 17:58:25 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E6=95=B0=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Assets/Scripts/CXX/Score/ScoreManager.cs | 3 ++-
.../Project/UI/UI_Item/UI_PracticeInfoItem.cs | 10 +++++-----
.../UI/UI_Panel/UI_PracticeCompletedPanel.cs | 16 +++++++++++-----
3 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/Assets/Scripts/CXX/Score/ScoreManager.cs b/Assets/Scripts/CXX/Score/ScoreManager.cs
index 25daa4f..16988ff 100644
--- a/Assets/Scripts/CXX/Score/ScoreManager.cs
+++ b/Assets/Scripts/CXX/Score/ScoreManager.cs
@@ -40,7 +40,7 @@ public class ScoreManager : MonoBehaviour
scoreSubjectList.Find(a => a.systemId == systemctlid && a.schemeId == schemeid)?.CheckScore(triggerName, para);
}
///
- /// 获取总分
+ /// 根据方案/科目ID获取总分
///
///
///
@@ -62,4 +62,5 @@ public class ScoreManager : MonoBehaviour
return scoreModel;
}
+
}
diff --git a/Assets/Scripts/Project/UI/UI_Item/UI_PracticeInfoItem.cs b/Assets/Scripts/Project/UI/UI_Item/UI_PracticeInfoItem.cs
index 9d50d65..9c7a08e 100644
--- a/Assets/Scripts/Project/UI/UI_Item/UI_PracticeInfoItem.cs
+++ b/Assets/Scripts/Project/UI/UI_Item/UI_PracticeInfoItem.cs
@@ -9,11 +9,11 @@ public class UI_PracticeInfoItem : BaseItem
public TextMeshProUGUI point;
public TextMeshProUGUI pointInfo;
public TextMeshProUGUI score;
- public void Init(string _number,string _point,string _pointInfo,string _score)
+ public void Init(int count, ScoreInfo sInfo)
{
- number.text = _number;
- point.text = _point;
- pointInfo.text = _pointInfo;
- score.text = _score;
+ number.text = count.ToString();
+ point.text = sInfo.point;
+ pointInfo.text = sInfo.pointInfo;
+ score.text = $"{sInfo.pointScore}/{sInfo.maxScore}";
}
}
diff --git a/Assets/Scripts/Project/UI/UI_Panel/UI_PracticeCompletedPanel.cs b/Assets/Scripts/Project/UI/UI_Panel/UI_PracticeCompletedPanel.cs
index 57ba759..fbe7985 100644
--- a/Assets/Scripts/Project/UI/UI_Panel/UI_PracticeCompletedPanel.cs
+++ b/Assets/Scripts/Project/UI/UI_Panel/UI_PracticeCompletedPanel.cs
@@ -10,11 +10,17 @@ public class UI_PracticeCompletedPanel : BasePanel
public RectTransform content;
public void Init()
{
- //ScoreManager.instance.GetScore();
- //ScoreManager.instance.GetStepScore();
- UI_PracticeInfoItem temp = Instantiate(piiPrefab, content);
+ ScoreModel scoreModel = ScoreManager.instance.GetScore(GameManager.RunModelMgr.schemeID);
+
+ for (int i = 0; scoreModel.pointList.Count > 0; i++)
+ {
+ int index = i;
+ UI_PracticeInfoItem temp = Instantiate(piiPrefab, content);
+ temp.Init(index + 1, scoreModel.pointList[index]);
+ }
+
+ GetControl("ScoreRes").text = scoreModel.score.ToString();
GetControl("UsedTimesRes").text = "00:555";
- GetControl("ScoreRes").text = "123";
}
protected override void OnClick(string btnName)
@@ -28,10 +34,10 @@ public class UI_PracticeCompletedPanel : BasePanel
GameManager.Instance.ShowUIPanelAndLoadScene(true);
break;
case "closeBtn":
+ GameManager.UIMgr.HidePanel();
break;
default:
break;
}
- GameManager.UIMgr.HidePanel();
}
}