private void Update() { bool active = PlayerManager.instance.SecondPlayerStatus != PlayerManager.PlayerStatus.Online && !DLCMenu.InDLCMenu; splitScreenNotification.gameObject.SetActive(active); splitScreenNotification.SplitRefreshEnable(LevelSelectMenu2.InLevelSelectMenu || CustomizationPresetMenu.InCustomizationPresetMenu); splitScreenNotification.DLCAvailableEnable(MainMenu.InMainMenu && DLC.instance.SupportsDLC()); lobbySelectMenuOptions.gameObject.SetActive(MultiplayerSelectLobbyMenu.InLobbySelectMenu); multiplayerMenuOptions.gameObject.SetActive(multiplayerMenuOptions.ShouldShow); bool flag = false; MenuTransition activeMenu = MenuSystem.instance.activeMenu; if (activeMenu != null && !DialogOverlay.IsOnIncludingDelay() && App.state != AppSate.LoadLevel) { flag = true; if (activeMenu is MultiplayerErrorMenu || activeMenu is ConfirmMenu) { flag = false; } } if (SteamProgressOverlay.instance.DialogShowing()) { flag = false; } if (LegendBar.activeSelf != flag) { LegendBar.SetActive(flag); } }
/// <summary> /// Hide menu /// </summary> public virtual void hideMenu(float transitionTimer, MenuTransition path = MenuTransition.BACKWARD, Callback callback = null) { // Stop any transition that's currently in effect TransitionHandler.removeTransition(alphaTransition); TransitionHandler.removeTransition(positionTransition); if(transitionTimer == 0.0f) { // Make UI object invisible imgAlpha.alpha = 0.0f; // Turn off the UI game object gameObject.SetActive(false); if(callback != null) { callback(); } } else { // Animate the position transition positionTransition = TransitionHandler.addTransition(() => Vector2.zero, x => menuTransform.anchoredPosition = x, new Vector2(0, -30), transitionTimer).toggleTimeScale(false); // Fade out the menu then disable the object after it's finished fading out alphaTransition = TransitionHandler.addTransition(()=>getAlpha.alpha, x => getAlpha.alpha = x, 0.0f, transitionTimer).toggleTimeScale(false).finishLerp(() => { gameObject.SetActive(false); if (callback != null) { callback(); } }); } }
public void FadeInForward(MenuTransition to, float fadeInTime = 0.3f) { to.gameObject.SetActive(value: true); to.Transition(1f, 0f); to.Transition(0f, fadeInTime); to.ApplyMenuEffects(); activeMenu = to; to.OnGotFocus(); }
public void TransitionBack <T>(MenuTransition from, float fadeOutTime = 0.3f, float fadeInTime = 0.3f) where T : MenuTransition { T menu = GetMenu <T>(); if (!((UnityEngine.Object)menu == (UnityEngine.Object)null)) { FadeOutBack(from, fadeOutTime); FadeInBack(menu, fadeInTime); } }
public void SwitchScene(string a_name) { m_NextScene = a_name; MenuTransition menuTransition = GetComponent <MenuTransition>(); if (menuTransition.GetIsTransitioning() == false) { menuTransition.StartTransition(); } }
private void Awake() { MenuTransition[] array = Object.FindObjectsOfType <MenuTransition>(); for (int i = 0; i < array.Length; i++) { if (array[i].gameObject.activeSelf) { statupMenu = array[i]; } } }
public void HideMenus() { MenuCameraEffects.FadeOut(); MenuTransition menuTransition = activeMenu; instance.ExitMenus(); if (menuTransition != null) { menuTransition.FadeOutBack(); } }
public void ExitMenus() { if (activeMenu != null) { activeMenu.Transition(1f, 1f); activeMenu.Transition(1f, 0f); } state = MenuSystemState.Inactive; activeMenu = null; ExitMenuInputMode(); SubtitleManager.instance.Show(); }
public void ShowPauseMenu() { state = MenuSystemState.PauseMenu; MenuTransition to = (Game.instance.currentLevelNumber != Game.instance.levelCount) ? ((MenuTransition)GetMenu <PauseMenu>()) : ((MenuTransition)GetMenu <CreditsMenu>()); if (!NetGame.isLocal) { to = GetMenu <MultiplayerPauseMenu>(); } FadeInForward(to); EnterMenuInputMode(); SubtitleManager.instance.Hide(); }
private void Start() { Dependencies.Initialize <App>(); GetComponentInChildren <Camera>().gameObject.SetActive(value: false); App.instance.BeginMenuDev(); if (statupMenu == null) { statupMenu = MenuSystem.instance.GetMenu <MainMenu>(); } MenuSystem.instance.FadeInForward(statupMenu); MenuSystem.instance.EnterMenuInputMode(); SubtitleManager.instance.Hide(); MenuSystem.instance.OnShowingMainMenu(); }
/// <summary> /// Show menu /// </summary> public virtual void showMenu(float transitionTimer, MenuTransition path = MenuTransition.FORWARD, Callback callback = null) { // Turn on the actual UI game object gameObject.SetActive(true); // Stop any transition that's currently in effect TransitionHandler.removeTransition(alphaTransition); TransitionHandler.removeTransition(positionTransition); // Don't make a transition if the method calls for instantaneous switch if (transitionTimer == 0.0f) { imgAlpha.alpha = 1.0f; if (callback != null) { callback(); } } else { // Create and initiate the transition animations positionTransition = TransitionHandler.addTransition(() => new Vector2(0, -30), x => menuTransform.anchoredPosition = x, Vector2.zero, transitionTimer).toggleTimeScale(false); alphaTransition = TransitionHandler.addTransition(() => getAlpha.alpha, x => getAlpha.alpha = x, 1.0f, transitionTimer).finishLerp(callback).toggleTimeScale(false); } // set our default UI item so it has focus. EventSystem.current.SetSelectedGameObject(currentUI); }
public void Overlay(MenuTransition p) { Transition(true, true, p.next, p.exitHash, p.enterHash); }
// delet this //void Update() //{ // if (Input.GetKeyDown(KeyCode.P)) // { // while (menuStack.Count > 0) // { // Debug.Log(menuStack.Pop()); // } // } //} public void Transition(MenuTransition p) { Transition(true, false, p.next, p.exitHash, p.enterHash); }
private void MoveCursorMenu(int index) { MenuTransition.OnApplyTemplate(); GridCursor.Margin = new Thickness(0, 100 + 60 * index, 0, 0); }
public void FadeOutBack(MenuTransition from, float fadeOutTime = 0.3f) { FocusOnMouseOver(enable: false); from.Transition(1f, fadeOutTime); from.OnLostFocus(); }
public void MenuTransitionedIn(MenuTransition menu) { FocusOnMouseOver(enable: true); menu.OnTansitionedIn(); }