Author Topic: NGUI QualitySettings Javascript bug 3.5.4a  (Read 3087 times)

HazardousInteractive

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 5
    • View Profile
NGUI QualitySettings Javascript bug 3.5.4a
« on: May 08, 2014, 06:31:48 PM »
I was scripting a button's OnClick function when, to set the quality settings, like this
  1. #pragma strict
  2. var buttons : GameObject[];
  3. var quality : int;
  4.  
  5.  
  6. function Start () {
  7.  
  8. }
  9.  
  10. function OnClick () {
  11.         QualitySettings.SetQualityLevel(quality, true);
  12. }
  13.  
The console said: "SetQualityLevel is not a member of QualitySettings".
Then I though it was a bug with unity, but I did the same line in an empty project and it didn't hit a compiler error. Then I thought it was one of the plugins messing up, and I deleted a all the other plugins, but nothing so I had to restore them because the error didn't go away, then I deleted the NGUI and Plugins folder, and then it worked. I restored it and tried scripting the same thing in C# and it worked, even after doing the supposed "NGUI Javascript setup" where you move the folders to the plugins and ngui folder.

TL;DR:
QualitySettings.SetQualityLevel() doesn't work in js even after doing the js setup in NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI QualitySettings Javascript bug 3.5.4a
« Reply #1 on: May 09, 2014, 05:34:01 AM »
NGUI doesn't define a class called QualitySettings, so do a search in your Project view for that name, and you will find the script responsible.