Ejemplo n.º 1
0
        public void loadMainUI()
        {
            GameObject MainUI = RG_Utils.loadPrefeb("MainUIRoot", "Reserved/UI/MainUI/MainUIRoot");

            if (UISystem_ != null)
            {
                MainUI.transform.parent = UISystem_.transform;
                uiRoot_ = MainUI.GetComponent <UIRoot>();
            }
            commonUIAnchor_ = GameObject.Find("ComCenterAnchor");
            loginUIAnchor_  = GameObject.Find("LoginCenterAnchor");
            moviePanel_     = GameObject.Find("MoviePanel");
            UICamera   MainUICamera = MainUI.GetComponentInChildren <UICamera>();
            GameObject MainUiWindow = RG_Utils.loadPrefeb("MainUIWindow", "Reserved/UI/MainUI/MainUIWindow");

            MainUiWindow.gameObject.SetActive(true);
            MainUiWindow.transform.parent = MainUICamera.transform;
            mainUIPanel_  = GameObject.Find("MainUIPanel");
            _tempParentUI = GameObject.Find("TempParentUI");
            mainUIWindow_ = GameObject.Find("MainUIWindow");
            UIWindow win = MainUiWindow.GetComponent <UIWindow>();

            windowList_.Add("MainUIWindow", win);
            MainUiWindow.SetActive(false);
        }
Ejemplo n.º 2
0
        static public GameObject addPrefebToWindowStatic(GameObject parent, string path, UI_LAYER layer, string name = "")
        {
            GameObject go = RG_Utils.loadPrefeb(name, path);

            if (go != null)
            {
                go.transform.parent = parent.transform;
                UIWidget[] uiWindgets = go.GetComponentsInChildren <UIWidget>(true);
                foreach (UIWidget widget in uiWindgets)
                {
                    widget.depth += (int)layer;
                }
                go.transform.localPosition = new Vector3(0, 0, -10);
                go.transform.localScale    = new Vector3(1, 1, 1);
            }
            return(addGameObjectToWindowStatic(parent, go, layer, name, false));
        }