- Home /
Settings Menu help
So I'm working on a settings menu in my game's pause menu.
I have mostly everything I need, except for one thing.
I don't know exactly what it would be called but it's the thing most games have for video settings where you can hit left/right or click arrows on either side to switch between different values.
Something like this:

Except instead of just toggling on/off it goes through multiple settings, like different AA levels.
Any idea how I can achieve this with UI objects and a C# script?
Although this might be a bit different then what you're thinking; but maybe you can just use button for the arrow and create a list or enum for the available options?
The way I can think of doing this is to create a list of all the options the player can scroll through and everytime the player click the button, you change the index that is used to scroll the list.
The button would be fine if I was going for just keyboard+mouse controls, but since I'm making this game gamepad compatible, it would get rather annyoing having to constantly switch between two arrows when you could just easily use left/right.
But the enum is what I was thinking of doing in the script itself. It's the UI that I'm worried about.
Sorry if I'm mistaken, but you mean using a game controller to go through the menu right? In that case, one way is to have an index of which option (out of the 4) is being selected and when the player pressed left/right, change the index for the enum of that option.
So you'll have 5 enums (currentSelectedOption, and 1 for each of the option inside the menu)
If I am understanding it wrong? Please do tell.
What I ended up doing still works, but it's a little different than that. Basically I took an easier route and just made a single button that adds to the index, wrapping back to 0 at the last option.
Your answer
Follow this Question
Related Questions
unity2020 iphone X and later cut off screen , 0 Answers
Adding EventTrigger listeners through code 0 Answers
4.6 UI Image follow mouse position? 4 Answers
How to create a 4.6 UI button NOT from prefab NOT in unity editor only from C# 1 Answer
How to have both, a scroll view AND vertical Layout? 1 Answer