private MenuScrollState _currentState; // The current state that we're in void Start() { _buttons = GetComponentsInChildren <Button>(); _currentIndex = -1; _currentSelectTime = 0f; _currentState = MenuScrollState.None; }
// Helper to change the state we're at and set the time we should be using. // When we first just switch to up or down, we don't want to wait or Delay Time, // so we immediately set our time to be the delay time. private void SetState(MenuScrollState newState, float newTime) { _currentState = newState; _currentSelectTime = newTime; }