From 8f0fc78f3eecaff90b31b81b371fe8f9cf741fc9 Mon Sep 17 00:00:00 2001 From: chenxiangxue <910695411@qq.com> Date: Tue, 3 Sep 2024 10:31:50 +0800 Subject: [PATCH] aa --- Assets/Scripts/CXX/Score/ScoreManager.cs | 27 ++++++++++++-------- Assets/Scripts/CXX/Score/ScoreSubjectStep.cs | 2 +- Assets/Scripts/CXX/Score/Score_1002.cs | 2 +- Assets/Scripts/CXX/ScoreModel.cs | 12 ++++++--- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Assets/Scripts/CXX/Score/ScoreManager.cs b/Assets/Scripts/CXX/Score/ScoreManager.cs index c32fc59..25daa4f 100644 --- a/Assets/Scripts/CXX/Score/ScoreManager.cs +++ b/Assets/Scripts/CXX/Score/ScoreManager.cs @@ -44,17 +44,22 @@ public class ScoreManager : MonoBehaviour /// /// /// - public float GetScore(int subjectid) + public ScoreModel GetScore(int subjectid) { - return scoreSubjectList.Find(a=>a.schemeId== subjectid).GetTotalScore(); - } - /// - /// 获取分步骤得分详情 - /// - /// - /// - public Dictionary GetStepScore(int subjectid) - { - return scoreSubjectList.Find(a => a.schemeId == subjectid).GetStepScore(); + ScoreBase sb=scoreSubjectList.Find(a=>a.schemeId== subjectid); + ScoreModel scoreModel = new ScoreModel(); + scoreModel.score= sb.GetTotalScore(); + var step=sb.GetStepScore(); + foreach (var item in step) + { + ScoreInfo scoreInfo = new ScoreInfo(); + scoreInfo.pointScore = item.Value.currentScore; + scoreInfo.maxScore = item.Value.maxScore; + scoreInfo.point = item.Value.step.subProcessName; + scoreInfo.pointInfo = item.Value.step.tips; + scoreModel.pointList.Add(scoreInfo); + } + + return scoreModel; } } diff --git a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs index d836558..eb88d53 100644 --- a/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs +++ b/Assets/Scripts/CXX/Score/ScoreSubjectStep.cs @@ -27,7 +27,7 @@ public class ScoreSubjectStep /// /// 步骤 /// - public D_SubProcess setp; + public D_SubProcess step; public ScoreSubjectStep(int subProcessId,float maxScore,bool isOneVoteVeto=false) { diff --git a/Assets/Scripts/CXX/Score/Score_1002.cs b/Assets/Scripts/CXX/Score/Score_1002.cs index e63c32c..d728dce 100644 --- a/Assets/Scripts/CXX/Score/Score_1002.cs +++ b/Assets/Scripts/CXX/Score/Score_1002.cs @@ -48,7 +48,7 @@ public class Score_1002 : ScoreBase for (int i = 0; i < steps.Count; i++) { - steps[i].setp = dsteps[i]; + steps[i].step = dsteps[i]; } //清理缓存 diff --git a/Assets/Scripts/CXX/ScoreModel.cs b/Assets/Scripts/CXX/ScoreModel.cs index dfde2e3..8d46243 100644 --- a/Assets/Scripts/CXX/ScoreModel.cs +++ b/Assets/Scripts/CXX/ScoreModel.cs @@ -1,12 +1,11 @@ using System; using System.Collections; using System.Collections.Generic; -using UnityEngine; [Serializable] public class ScoreModel { public string time; - public string score; + public float score; public List pointList = new List(); } [Serializable] @@ -14,5 +13,12 @@ public class ScoreInfo { public string point; public string pointInfo; - public string pointScore; + /// + /// 得分 + /// + public float pointScore; + /// + /// 总分 + /// + public float maxScore; }