コード例 #1
0
        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();
            }
        }
コード例 #2
0
 private void ClearTraceIfNeeded(MenuState lastState, MenuState newState)
 {
     if (lastState == newState)
     {
         return;
     }
     if (lastState == MenuState.Cart && newState == MenuState.Inventory)
     {
         ClearTrace();
     }
     if (newState.IsAuthState() ||
         newState == MenuState.Main ||
         newState == MenuState.Friends ||
         newState == MenuState.SocialFriends)
     {
         ClearTrace();
     }
 }
コード例 #3
0
 public static bool IsPostAuthState(this MenuState menuState) => !menuState.IsAuthState() && menuState != MenuState.None;