using UnityEngine; using UnityEngine.UI; using QFramework; using TMPro; using UnityEngine.SceneManagement; using System; namespace QFramework.Example { public class UIModuleSelectData : UIPanelData { } public partial class UIModuleSelect : UIPanel { protected override void OnInit(IUIData uiData = null) { mData = uiData as UIModuleSelectData ?? new UIModuleSelectData(); backBtn.onClick.AddListener(() => { Hide(); UIKit.OpenPanelAsync().ToAction().StartGlobal(); }); setBtn.onClick.AddListener(() => { UIKit.OpenPanelAsync(canvasLevel: UILevel.PopUI).ToAction().Start(this); }); closeBtn.onClick.AddListener(() => { Application.Quit(); }); } protected override void OnOpen(IUIData uiData = null) { Content.RemoveAllChildren(); for (int i = 0; i < Global.Instance.appData.Modules.Count; i++) { var item = Global.Instance.appData.Modules[i]; Global.AppType curType = Global.AppType.All; Enum.TryParse(item.type, out curType); if (curType == Global.appTpe || curType == Global.AppType.All) { int index = i; GameObject obj = GameObject.Instantiate(BtnItem.gameObject, Content); obj.transform.Find("Label").GetComponent().text = item.ModuleName; obj.GetComponent