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(); } }
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(); } }
public static bool IsPostAuthState(this MenuState menuState) => !menuState.IsAuthState() && menuState != MenuState.None;