private void OnStateChanged(MenuState lastState, MenuState newState)
        {
            if (lastState.IsPostAuthState() && newState.IsAuthState())
            {
                DestroyInstances();
                Token.Instance = null;
            }

            if (lastState.IsAuthState() && newState == MenuState.Main)
            {
                UpdateStore();
                UpdateInventory();
                AutoStartTutorial();
            }
        }
 public void SetPreviousState()
 {
     if (_currentState.IsPostAuthState() &&
         _currentState != MenuState.Main &&
         _currentState != MenuState.BuyCurrency &&
         _currentState != MenuState.Cart)
     {
         SetState(MenuState.Main);
     }
     else if (_stateTrace.Any())
     {
         var state = _stateTrace.Last();
         _stateTrace.RemoveAt(_stateTrace.Count - 1);
         SetState(state, addToTrace: false);
     }
     else
     {
         SetState(initialState);
     }
 }
        protected sealed override void OnStateChanged(MenuState _, MenuState newState)
        {
            if (newState.IsPostAuthState())
            {
                return;
            }

            if (StateObject == null)
            {
                return;
            }

            var pageController  = StateObject.GetComponent <LoginPageController>();
            var buttonsProvider = StateObject.GetComponent <LoginPageCommonButtonsProvider>();

            if (pageController == null && buttonsProvider == null)
            {
                return;
            }

            SetupButtons(buttonsProvider, newState);
            SetupPageChangingRules(newState, pageController, buttonsProvider);
        }