Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
-1
Question by ToeBeanGames · May 18, 2015 at 03:18 AM · uisettings

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:

alt text

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?

2015-05-17-00001.jpg (122.2 kB)
Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zaid87 · May 18, 2015 at 08:50 AM 0
Share

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.

avatar image ToeBeanGames · May 18, 2015 at 08:55 AM 0
Share

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.

avatar image zaid87 · May 18, 2015 at 09:11 AM 0
Share

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.

avatar image ToeBeanGames · May 18, 2015 at 09:12 AM 0
Share

Ah, that could work. I'll try it out.

avatar image ToeBeanGames · May 18, 2015 at 10:04 AM 0
Share

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.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges