Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Epic-Shot

GUI.Button Change Quality Settings.

Question

Hello ArmedUnity Members, I'm creating a MainMenu and i would love to have quality control for the player. I have a script.

 

here is a peice.

 

Please login or register to see this code.

I tryed.

QualitySettings.currentLevel = QualityLevel.Fastest;

But someone on Unity Answers said.

"

This is how you declare a variable: VARIABLE_TYPE VARIABLE_NAME;

QualitySettings.currentLevel means you are calling!! currentLevel parameter of object QualitySettings (or in your case it is Enum i guess)"

and posted this.

QualitySettings currentLevel = QualityLevel.Fastest;

 

I have tryed this but im getting a error telling me to add a semicolon.. But there is one.. Does anyone know something that will help get this functioning?

 

EDIT: I'm unity Unity 3.5

Share this post


Link to post
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Please login or register to see this link.

 

Everything you need to know is there. Note that the parameter takes a integer not a string, with 0 being the lowest graphics settings.

Share this post


Link to post
Share on other sites

  • 0

@Please login or register to see this link. Thanks for the link. I checked it out... but unfortently i'm unable to implement this into my script.. The script itself that it shows the example works but its not really what i had in mind. Thanks for info :)

Share this post


Link to post
Share on other sites
  • 0

QualitySettings.SetQualityLevel(0, false);

 

Put that in your if statement and it should work.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

'SetQualityLevel' is not a member of 'QualitySettings'. I have decided to //comment out all my options info just gonna stick with basic gui main menu then fix the options part :) Appreciate your help.

Share this post


Link to post
Share on other sites
  • 0

Call this on the button click.

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

obviously this isnt going to work by drag and dropping but here is the snippet from my own pause menu., hope it helps

 

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

Lol, nice one except I wouldn't want those button labels. At first I thought currentLevel was read-only

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

 

I'm mad how we have similar graphics selection layout, written the SAME exact way, except my code is in C#.

Share this post


Link to post
Share on other sites
  • 0

Nah I'm just pointing it out. Kind of a coincedence. lol

Great minds think alike.

Share this post


Link to post
Share on other sites
  • 0

:'( I don't think like you so that means I don't have a great mind? Lol just kidding. I wouldn't have done it this way though, that's for sure.

Share this post


Link to post
Share on other sites
  • 0

I technically did the handling differently, but the concept is the same. I used delegates to activate the layers and the display of the buttons. If you see where GraphicStack's code calls if showGraphicsDropDown == true, that isn't how I activate the layers.

 

I use seperate methods that contain if statements that check if a button ID is clicked.

 

Then I use

Please login or register to see this code.

to call back to a menu layer.

Share this post


Link to post
Share on other sites
  • 0

Why do you use obsolete syntax?

Edited by DarkChaos

Share this post


Link to post
Share on other sites
  • 0

Thanks for the info guys... Tryed

 

QualitySettings.currentLevel = QualityLevel.Simple;

 

but unity says 'currentLevel' is not a member of 'QualitySettings'.

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote. Why don't you look in FPSKit 2?

Main menu script has all you need.

Ok, here will be another example (from my old multiplayer project):

Please login or register to see this code.

Share this post


Link to post
Share on other sites
  • 0

if these arent working you might wanna check your projects quality settings, you might have renamed them or something

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...