/// <summary> Keep the current open page, call LostFocus on currentPage, /// and open the new page with input pageName </summary> //public void RequestKeepCurrentAndOpenNewPage(string pageName) { public void RequestKeepCurrentAndOpenNewPage(UIPage page) { if (page == null) { Log.Warning(false, this, "KeepCurrentAndOpenNewPage, with empty pageName", this); return; } ValidatePageExistInPagelist(page); // call Lost focus on current top page if (openPageList.Count > 0) { var currentTopPage = openPageList.Last.Value; currentTopPage.OnLostFocus(); } // TODO : open pageList > 0, check if the request page already showup else { if (openPageList.Contains(page)) { Log.Warning(false, this, "KeepCurrentAndOpenNewPage, Page [{0}] already showup", page); return; } } // let the new page on top page.transform.SetAsLastSibling(); // push to stack and Show page.Show(); openPageList.AddLast(page); // logging const string FORMAT = "KeepCurrentAndOpenNewPage : {0}"; LogOpenClosePageProcessToConsole(FORMAT, page.name); }
public static void LoadPage <T>(object dat = null) where T : UIPage, new() { if (CurrentPage is T) { CurrentPage.Show(dat); return; } UIAnimation.Manage.ReleaseAll(); if (CurrentPage != null) { CurrentPage.Save(); CurrentPage.Dispose(); } var t = new T(); t.Initial(Root, dat); t.ReSize(); CurrentPage = t; }
public void TriggerEvent(string trigger) { if (gameState == GameState.Exploration) { _gameState = GameState.Event; _eventUIPage.Show(); } _eventController.TriggerEvent(trigger); }
public static void LoadPage <T>(object dat = null) where T : UIPage, new() { if (CurrentPage is T) { CurrentPage.Show(dat); return; } EventCallBack.ClearEvent(); AnimationManage.Manage.ReleaseAll(); if (CurrentPage != null) { CurrentPage.Save(); CurrentPage.Dispose(); } var t = new T(); t.Initial(Root, dat); t.ReSize(); CurrentPage = t; t.ChangeLanguage(); }
public void ShowPage(int index) { if (activePage != null) { activePage.Hide(); } if (index >= 0 && index < pages.Length) { activePage = pages[index]; activePage.Show(); } }
public static void LoadPage <T>(object dat = null) where T : UIPage, new() { if (CurrentPage is T) { CurrentPage.Show(dat); return; } if (HCanvas.MainCanvas != null)//释放当前页面所有事件 { HCanvas.MainCanvas.ClearAllAction(); } TextInput.Clear(); if (CurrentPage != null) { CurrentPage.Save(); CurrentPage.Dispose(); } var t = new T(); t.Initial(Root, dat); t.ReSize(); CurrentPage = t; }
/// <summary> /// UI 的管理 涉及 /// 是否异步生成 /// /// 是否同步显示 /// /// </summary> /// <param name="pageName"></param> /// <param name="page"></param> /// <param name="isAsync"> /// 是否同步显示 /// 比如抽奖面板 你需要一个个显示出来 那么就是异步生成 那么就可以 loadFunc(callBack) /// loadFunc 里面延时处理 callBack 生成回调 /// </param> /// <param name="callBack"></param> public void ShowPage(string pageName, UIPage page, bool isAsync, Callback <Callback> loadFunc, Callback callBack) { if (string.IsNullOrEmpty(pageName) || page == null) { Debug.LogError(" string.IsNullOrEmpty(pageName) || page == null "); return; } //if (isAsync) //page.Show(callBack); else { page.Show(); } }
private IEnumerator goToMainMenu(float seconds) { yield return(new WaitForSeconds(seconds)); DestroyGame(); AsyncOperation async = SceneManager.LoadSceneAsync(0); while (!async.isDone) { _loadingScreen.SetProgress(Mathf.Clamp01(async.progress / 0.9f)); yield return(null); } _loadingScreen.Hide(1.0f); _mainMenuUIPage.Show(); }
public UIPage ShowPage(UIID uid) { UIPage page = GetPage(uid); if (page == null) { return(null); } if (page.IsActive) { Debug.LogWarning("Show ui not needed: " + uid + " is already showing."); return(null); } switch (page.popupMode) { case PopupMode.Hide_All: foreach (var p in ui_dict_all.Values) { p.Hide(); ui_dict_show.Clear(); } break; case PopupMode.Simple: break; case PopupMode.Hide_Other_Peer: foreach (var p in ui_dict_show.Values) { if (p.pageLevel == page.pageLevel) { p.Hide(); } } break; default: break; } page.Show(); ui_dict_show.Add(uid, page); return(page); }
/// <summary> Close the top open page (currentPage) and open the new page (with pageName) </summary> public void RequestCloseCurrentAndOpenNewPage(UIPage page) { if (page == null) { Log.Warning(false, this, "CloseCurrentAndOpenNewPage, with empty pageName", this); return; } ValidatePageExistInPagelist(page); // close current page, popup it out of the openPageList too UIPage topPage = null; if (openPageList.Count > 0) { topPage = openPageList.Last.Value; topPage.Hide(); openPageList.RemoveLast(); } else { Log.Warning(false, this, "OpenPageStack is empty but request CloseCurrentAndOpenNewPage"); } // let the new page on top render, also add it to last in openPageStack page.transform.SetAsLastSibling(); openPageList.AddLast(page); // if currentPage = null, then just simple show new page if (topPage == null) { page.Show(); } // else, wait a little for currentPage to Hide, then show newPage else { Observable.Timer(TimeSpan.FromSeconds(topPage.HideDuration)).Subscribe(_ => page.Show()).AddTo(_destroyDispose); } // logging const string FORMAT = "CloseCurrentAndOpenNewPage : {0}"; LogOpenClosePageProcessToConsole(FORMAT, page.name); }
/// <summary> /// Unpauses the game /// </summary> public void UnPauseGame() { _generalGuiPage.Show(); _isPaused = false; }
/// <summary> /// Pauses the game /// </summary> public void PauseGame() { _pauseGuiPage.Show(); _isPaused = true; }
public override void OnControllerActivated(InputModule module) { mainPage.Show(); }