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; }
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); }
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; } }
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); }
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); } }
/// <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); }
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); }
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(); }