添加分数获取

This commit is contained in:
YangHua 2024-09-03 17:58:25 +08:00
parent 8f0fc78f3e
commit 066c238fea
3 changed files with 18 additions and 11 deletions

View File

@ -40,7 +40,7 @@ public class ScoreManager : MonoBehaviour
scoreSubjectList.Find(a => a.systemId == systemctlid && a.schemeId == schemeid)?.CheckScore(triggerName, para);
}
/// <summary>
/// 获取总分
/// 根据方案/科目ID获取总分
/// </summary>
/// <param name="subjectid"></param>
/// <returns></returns>
@ -62,4 +62,5 @@ public class ScoreManager : MonoBehaviour
return scoreModel;
}
}

View File

@ -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 = $"<color=#00EEE6>{sInfo.pointScore}<color>/{sInfo.maxScore}";
}
}

View File

@ -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<TextMeshProUGUI>("ScoreRes").text = scoreModel.score.ToString();
GetControl<TextMeshProUGUI>("UsedTimesRes").text = "00:555";
GetControl<TextMeshProUGUI>("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<UI_PracticeCompletedPanel>();
break;
default:
break;
}
GameManager.UIMgr.HidePanel<UI_PracticeCompletedPanel>();
}
}