using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using ZXKFramework; namespace DongWuYiXue.DaoNiaoShu { public class ShiXunPanel : UIBase { RectTransform content; GameObject step; public override string GroupName => "ShiXunPanel"; public override string Name => "ShiXunPanel"; public override void Init(IUIManager uictrl) { base.Init(uictrl); content = transform.FindFirst("Content"); step = transform.FindFirst("Step").gameObject; } int seq = 0; public override void Show() { base.Show(); GeneSteps(); } void GeneSteps() { List listBaseData = GetModel().excelData.allBaseData; for (int i = 0; i < listBaseData.Count; i++) { BaseData b = listBaseData[i]; if (string.IsNullOrEmpty(b.score_sx)) continue; GameObject obj = Instantiate(step, content); obj.SetActive(true); Text id = obj.transform.FindFirst("ID"); Text name = obj.transform.FindFirst("Name"); Text type = obj.transform.FindFirst("Type"); Text maxScore = obj.transform.FindFirst("MaxScore"); Text score = obj.transform.FindFirst("Score"); seq++; id.text = seq.ToString(); name.text = GetModel().excelData.GetTreeViewDatastate(b.state).data2; type.text = b.type; maxScore.text = b.score_sx; score.text = b.score_sx; } } } }