65 lines
1.8 KiB
C#
65 lines
1.8 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using QFramework;
|
|
using Unity.VisualScripting;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using XMLTool;
|
|
using TMPro;
|
|
|
|
namespace QFramework.Example
|
|
{
|
|
public class UIScoreData : UIPanelData
|
|
{
|
|
}
|
|
public partial class UIScore : UIPanel
|
|
{
|
|
protected override void OnInit(IUIData uiData = null)
|
|
{
|
|
mData = uiData as UIScoreData ?? new UIScoreData();
|
|
|
|
DownLoad.onClick.AddListener(() =>
|
|
{
|
|
if (string.IsNullOrEmpty(InputName.text) || string.IsNullOrEmpty(InputId.text))
|
|
{
|
|
Debug.LogError("ÐÕÃû»òÕßѧºÅΪ¿Õ");
|
|
return;
|
|
}
|
|
});
|
|
Confirm.onClick.AddListener(Hide);
|
|
}
|
|
|
|
|
|
|
|
protected override void OnOpen(IUIData uiData = null)
|
|
{
|
|
|
|
Content.RemoveAllChildren();
|
|
float sum = 0;
|
|
float score = 0;
|
|
foreach (var item in ScoreController.Instance.scoreDict)
|
|
{
|
|
GameObject obj = GameObject.Instantiate(ItemPrefab.gameObject, Content);
|
|
obj.transform.Find("Step").GetComponent<TextMeshProUGUI>().text = item.Value.step;
|
|
obj.transform.Find("Name").GetComponent<TextMeshProUGUI>().text = item.Value.name;
|
|
obj.transform.Find("Sum").GetComponent<TextMeshProUGUI>().text = item.Value.sum;
|
|
obj.transform.Find("Score").GetComponent<TextMeshProUGUI>().text = item.Value.value.ToString();
|
|
sum += float.Parse(item.Value.sum);
|
|
score += item.Value.value;
|
|
}
|
|
}
|
|
|
|
protected override void OnShow()
|
|
{
|
|
}
|
|
|
|
protected override void OnHide()
|
|
{
|
|
}
|
|
|
|
protected override void OnClose()
|
|
{
|
|
}
|
|
}
|
|
}
|