Author Topic: Save Slider Position?  (Read 5175 times)

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Save Slider Position?
« on: November 18, 2012, 07:47:00 PM »
I just bought NGUI and it has worked flawlessly so far but I am having a little bit of trouble. (Tried using search and nothing turned up)
I am using a Slider to set the difficulty for my game, this works fine. However on the next run for the game I want to save the current position of the thumb of the slider so it matches what it was set to before. 

So far I am saving the Vector3 (X,Y and Z) coordinates into PlayerPrefs and calling them on Start in hopes that it would re-position the thumb to what it was previously.  Am I going about this in a wrong way or is there a more efficient way that NGUI has setup that I am oblivious too?

Thanks  ;)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Save Slider Position?
« Reply #1 on: November 18, 2012, 08:01:09 PM »
You should save UISlider.sliderValue instead.

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: Save Slider Position?
« Reply #2 on: November 18, 2012, 08:13:13 PM »
Worked perfectly  ;D   Thanks