private void Start() { eventSystem = EventSystem.current; currentState = new MenuMainState(); currentState.Enter(this); StartCoroutine(PlayMusicDelay()); }
public void ChangeState(string state) { if (states.ContainsKey(state)) { currentState = states[state]; currentState.Enter(); } }
private void ChangeState(MenuState menuState) { ServiceLocator.GetAudio().PlaySound("Pickup_Recharge", SoundType.menuSound); ServiceLocator.GetGamepadRumble().StartGamepadRumble(GamepadRumbleProvider.RumbleSize.small); SetMenuAboveButton(); currentState.Exit(this); currentState = menuState; currentState.Enter(this); }
public void GoBack() { if (aboveState != null) { ServiceLocator.GetAudio().PlaySound("Pickup_Recharge", SoundType.normal); ServiceLocator.GetGamepadRumble().StartGamepadRumble(GamepadRumbleProvider.RumbleSize.small); currentState.Exit(this); currentState = aboveState; currentState.Enter(this); if (selectedInMenu2 != null) { eventSystem.SetSelectedGameObject(selectedInMenu2); selectedInMenu2 = null; } else { eventSystem.SetSelectedGameObject(selectedInMenu1); selectedInMenu1 = null; } } }