35 lines
1.3 KiB
C#
35 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function 考试成绩面板控制-简略面板控制
|
|
*******************************************************************************/
|
|
namespace ZXK.ZPS
|
|
{
|
|
public class ExamBriefResultCtrl : MonoBehaviour
|
|
{
|
|
[SerializeField]//一级简介成绩容器
|
|
private Transform _firstBriefResultItemContain = null;
|
|
[SerializeField]//一级简介成绩预制体
|
|
private GameObject _firstBriefResultItemPrefab = null;
|
|
[SerializeField]
|
|
private Button _DetailBtn = null;
|
|
|
|
public void InitialBriefResult(Dictionary<string, int> result)
|
|
{
|
|
foreach (var item in result)
|
|
{
|
|
GameObject itemGeo = Instantiate(_firstBriefResultItemPrefab, _firstBriefResultItemContain);
|
|
itemGeo.transform.Find("ProcessNameText").GetComponent<Text>().text = item.Key;
|
|
itemGeo.transform.Find("ProcessResultText").GetComponent<Text>().text = item.Value.ToString();
|
|
itemGeo.name = item.Key;
|
|
}
|
|
_DetailBtn.onClick.AddListener(() =>
|
|
{
|
|
transform.parent.GetComponent<ExamResultScoreCtrl>().ShowDetailScore();
|
|
});
|
|
}
|
|
}
|
|
} |