// 创建副界面 protected virtual T CreateSubView <T>(string path) where T : UView { if (ViewLevel == ViewLevel.Sub) { CLog.Error("错误! 副界面无法再次创建副界面"); return(null); } T tempUI = UIMgr.CreateUIGO <T>(path); tempUI.Attach(ViewLevel.Main, this); tempUI.Callback_OnOpen += OnOpenSubView; tempUI.Callback_OnClose += OnCloseSubView; return(tempUI); }
// 创建Panel protected T CreatePanel <T>(string path) where T : UPanel { T panel = UIMgr.CreateUIGO <T>(path); if (panel == null) { return(null); } panel.Trans.SetParent(Trans); panel.ResetSourcePosData(); panel.Trans.SetAsLastSibling(); panel.GO.name = path; panel.PUIView = this; AddPanel(panel); return(panel); }