Ejemplo n.º 1
0
 public ScreenInfo(UIControlBase controller, bool showmask, ScreenPopCallback popcallback)
 {
     screenController = controller;
     showDarkBG       = showmask;
     screenOrder      = 0;
     popCallback      = popcallback;
 }
Ejemplo n.º 2
0
        public UIControlBase OpenScreen(string screenname, bool toShowDarkMask, ScreenPopCallback popcallback, Dictionary <string, string> propertyList)
        {
            Logger.LogInfo(this, "UIControlBase.AddScreen screen name=" + screenname + " toShowDarkMask=" + toShowDarkMask + " propertyList=" + propertyList);
            UIControlBase uIControlBase = null;
            GameObject    gameObject    = new GameObject(screenname);
            RectTransform rectTransform = gameObject.AddComponent <RectTransform>();

            gameObject.transform.SetParent(ScreenRootObject.transform, worldPositionStays: false);
            rectTransform.anchorMin  = Vector2.zero;
            rectTransform.anchorMax  = Vector2.one;
            rectTransform.offsetMin  = Vector2.zero;
            rectTransform.offsetMax  = Vector2.zero;
            rectTransform.localScale = Vector3.one;
            UIBuilder.Instance.buildScreen(screenname, gameObject);
            uIControlBase = gameObject.GetComponent <UIControlBase>();
            uIControlBase.LoadUI(propertyList);
            ScreenInfo screen = new ScreenInfo(uIControlBase, toShowDarkMask, popcallback);

            PushScreen(screen);
            return(uIControlBase);
        }