Beispiel #1
0
        public T GetUIPage <T>() where T : UIPageBase, new()
        {
            UIPageBase page = new UIPageBase();

            _UIPages.TryGetValue(typeof(T).ToString(), out page);
            return((T)page);
        }
Beispiel #2
0
        public UIPageBase GetUIPage(string UIPageName)
        {
            UIPageBase page = new UIPageBase();

            _UIPages.TryGetValue(UIPageName, out page);
            return(page);
        }
Beispiel #3
0
        public GComponent GetUIPageComponent(string UIPageName)
        {
            UIPageBase page = new UIPageBase();

            if (GetUIPage(UIPageName, out page))
            {
                return(page.Component);
            }
            return(null);
        }
Beispiel #4
0
        public T2 GetUIPageComponent <T, T2>()
            where T : UIPageBase, new()
            where T2 : GComponent
        {
            UIPageBase page = new UIPageBase();

            if (GetUIPage(typeof(T).ToString(), out page))
            {
                return((T2)page.Component);
            }
            return(null);
        }
Beispiel #5
0
        public override void Init()
        {
            BindAll();
            _UIPages = new Dictionary <string, UIPageBase>();
            GRoot.inst.SetContentScaleFactor(1920, 1080);
            foreach (int UILayer in Enum.GetValues(typeof(e_UILayer)))
            {
                string     layerName   = Enum.GetName(typeof(e_UILayer), UILayer);
                GComponent UIComponent = new GComponent();
                UIComponent.gameObjectName = layerName;
                GRoot.inst.AddChild(UIComponent);

                UIPageBase page = new UIPageBase(layerName, UIComponent);
                _UIPages.Add(layerName, page);
            }
        }
Beispiel #6
0
 public bool GetUIPage <T>(out UIPageBase page) where T : UIPageBase, new()
 {
     _UIPages.TryGetValue(typeof(T).ToString(), out page);
     return(page == null ? false : true);
 }
Beispiel #7
0
 public bool GetUIPage(string UIPageName, out UIPageBase page)
 {
     _UIPages.TryGetValue(UIPageName, out page);
     return(page == null ? false : true);
 }