Example #1
0
    static private void SetUICamera()
    {
        UICamera = UIRoot.Find(UINodeName.UICamera).GetComponent <Camera>();
        //float width = Screen.width / UIConst.UI_SIZE_WIDTH;
        //float height = Screen.height / UIConst.UI_SIZE_HEIGHT;
        //UIUtils.UIScaleFactor = Mathf.Min(width, height);

        //CamerasMgr.CameraUI.orthographicSize = 1.0f;//CamerasMgr.CameraUI.orthographicSize = 1280.0f;
        //CamerasMgr.CameraUI.nearClipPlane = -2000.0f;
        //CamerasMgr.CameraUI.farClipPlane = 2000.0f;
    }
Example #2
0
 public UIManager()
 {
     uiPanelList       = new Dictionary <string, UIBase>();
     UI                = AssetManager.LoadPrefab(uiPrefabPath + "UI").transform;
     UIRoot            = UI.Find("Canvas");
     UITop             = UIRoot.Find("Top");
     UIMid             = UIRoot.Find("Mid");
     UIBot             = UIRoot.Find("Bot");
     RootCanvas        = UIRoot.GetComponent <Canvas>();
     RootRectTransform = UIRoot.GetComponent <RectTransform>();
     RootScaler        = UIRoot.GetComponent <CanvasScaler>();
     Object.DontDestroyOnLoad(UI.gameObject);
 }
Example #3
0
        public static void Show()
        {
            ms_instance = UIRoot.Find <AppLoginPanel>("AppLoginPanel");

            if (ms_instance != null)
            {
                if (!ms_instance.gameObject.activeSelf)
                {
                    ms_instance.gameObject.SetActive(true);
                }
                ms_instance.txtName.text = AppConfig.Value.mainUserData.name;
            }
        }
Example #4
0
 private UIManager()
 {
     uiPanelList       = new Dictionary <string, UIBase>();
     UI                = ResLoad.LoadPrefab(uiPrefabPath + "UI").transform;
     UIRoot            = UI.Find("Canvas");
     UITop             = UIRoot.Find("Top");
     UIMid             = UIRoot.Find("Mid");
     UIBot             = UIRoot.Find("Bot");
     RootCanvas        = UIRoot.GetComponent <Canvas>();
     RootRectTransform = UIRoot.GetComponent <RectTransform>();
     RootScaler        = UIRoot.GetComponent <CanvasScaler>();
     Object.DontDestroyOnLoad(UI.gameObject);
     ScreenToUI(new Vector3(Screen.width, Screen.height), out screenUI);
 }
Example #5
0
        public static void Show(string title, float progress)
        {
            ms_instance = UIRoot.Find <AppLoading>("AppLoading");


            if (ms_instance != null)
            {
                if (!ms_instance.gameObject.activeSelf)
                {
                    ms_instance.gameObject.SetActive(true);
                }
                ms_instance.ShowProgress(title, progress);
            }
        }
Example #6
0
    /// <summary>
    /// 打开ui界面通用接口
    /// 不能被外部调用
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="name"></param>
    /// <param name="arg"></param>
    /// <param name="implType"></param>
    /// <returns></returns>
    private T Open <T>(string name, object arg = null, Type implType = null) where T : UIPanel
    {
        T ui = UIRoot.Find <T>(GetShortUIName(name));

        if (ui == null)
        {
            ui = Load <T>(name, implType);
        }
        if (ui != null)
        {
            if (loadedPanelList.IndexOf(ui) < 0)
            {
                loadedPanelList.Add(ui);
            }

            ui.Open(arg);
            UIRoot.Sort();
        }
        else
        {
            Debug.LogError("UI不存在:" + name);
        }
        return(ui);
    }
Example #7
0
        public T Open <T>(string name, object arg = null, Type implType = null) where T : UIPanel
        {
            T ui = UIRoot.Find <T>(GetShortUIName(name));

            if (ui == null)
            {
                ui = Load <T>(name, implType);
            }
            if (ui != null)
            {
                if (m_listLoadedPanel.IndexOf(ui) < 0)
                {
                    m_listLoadedPanel.Add(ui);
                }

                ui.Open(arg);
                UIRoot.Sort();
            }
            else
            {
                Debuger.LogError("UI不存在:{0}", name);
            }
            return(ui);
        }
Example #8
0
    private void BindRoot()
    {
        GameObject root = GameObject.FindGameObjectWithTag("UIRoot");

        if (root == null)
        {
            Util.LogError("UIRoot is null!!");
            return;
        }

        UIRoot       = root.GetComponent <RectTransform>();
        mScreenSize  = UIRoot.sizeDelta;
        mScreenScale = UIRoot.localScale;

        UIBackground = UIRoot.Find("UIBackground") as RectTransform;
        UIModule     = UIRoot.Find("UIModule") as RectTransform;
        UIWindow     = UIRoot.Find("UIWindow") as RectTransform;
        UIPopup      = UIRoot.Find("UIPopup") as RectTransform;
        UIEffect     = UIRoot.Find("UIEffect") as RectTransform;
        Native       = new GameObject("Native").transform;

        // 宽屏适配
        WideScreen();
    }