Пример #1
0
        public T CreatePanel <T>(string assetsBundleName) where T : UIPanelBase
        {
            UIPanelBase obj = null;

            obj = GameUtils.CreateUIPanelAsset <T>(assetsBundleName);
            if (obj != null)
            {
                obj.OnInit();
                return(obj as T);
            }
            return(null);
        }
Пример #2
0
        public UIPanelBase GetPanel(Type type)
        {
            if (mPanelsManager.ContainsKey(type))
            {
                return(mPanelsManager[type]);
            }
            UIPanelBase          panel = null;
            UIPanelDataAttribute info;

            if (mPanelTypeMap.TryGetValue(type, out info))
            {
                panel = CreatePanel <UIPanelBase>(info.AssetsBundleName);
                if (!panel.ExIsNullOjbect())
                {
                    UIPanelController.SetPanel(panel, info.Hierarchy);
                    mPanelsManager.Add(type, panel);
                }
            }
            return(panel);
        }