public IEnumerator AddStartSence() { yield return(StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uistartgame.unity3d", "UIStartGame", true, false, (GameObject obj) => { LaunchUI sence = obj.AddComponent <LaunchUI>(); curSence = sence; if (loadingSence != null) { loadingSence.CloseUI(); } }))); }
/// <summary> /// Starts the open main user interface sence. /// 直接加载主场景到界面上; /// </summary> void StartOpenMainUISence() { curSenceType = UISenceType.mainUISence; StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uimain.unity3d", "uimain", true, true, (GameObject obj) => { MainUI sence = obj.AddComponent <MainUI>(); CloseCurSence(); if (loadingSence != null) { loadingSence.CloseUI(); } curSence = sence; })); // StartCoroutine(AddmainUIToSence()); }
/// <summary> /// Gotos the logon sence. /// 进入登录场景; /// </summary> public void GotoLogonSence() { curSenceType = UISenceType.logonUISence; StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uilogin.unity3d", "UILogin", true, false, (GameObject obj) => { CloseCurSence(); LoginUI sence = obj.AddComponent <LoginUI>(); curSence = sence; if (loadingSence != null) { loadingSence.CloseUI(); } })); // StartCoroutine(AddLoginUIToSence()); }
/// <summary> /// 添加场景内大loaidng 执行逻辑; /// /// </summary> /// <param name="isRemoveCurSence">loading 添加好之后是否删掉当前场景</param> /// <param name="endCall"></param> /// <param name="addCall"></param> /// <param name="args"></param> /// <typeparam name="T"></typeparam> public void AddLoadingUIToSence <T>(bool isRemoveCurSence, PreCtrlBase.EndLoading endCall, PreCtrlBase.EndAddLoadingUI addCall, params object[] args) where T : PreCtrlBase { // StartCoroutine(AddLoadingUI<T>(endCall, addCall, args)); if (loadingSence != null) { if (isRemoveCurSence) { CloseCurSence(); } T precCtrl = loadingSence.gameObject.AddComponent <T>(); precCtrl.loadingUICS = (LoadingUI)loadingSence; precCtrl.EndLoadCall = endCall; precCtrl.StarLoadData(args); if (addCall != null) { addCall(precCtrl); } } else { StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uiloading.unity3d", "uiloading", true, false, (GameObject obj) => { if (isRemoveCurSence) { CloseCurSence(); } LoadingUI diaSrc = obj.AddComponent <LoadingUI>(); T precCtrl = obj.AddComponent <T>(); precCtrl.loadingUICS = diaSrc; precCtrl.EndLoadCall = endCall; precCtrl.StarLoadData(args); loadingSence = diaSrc; if (addCall != null) { addCall(precCtrl); } })); } // }
public void RemoveOneUI(BaseSence ui) { ui = null; }