Author Topic: UIToggle Button  (Read 2779 times)

virginsteele

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
UIToggle Button
« on: July 10, 2014, 10:55:12 AM »
Hi there,

Apologies if this is a silly question as I'm not a programmer but I'm having a problem with the UI toggle NGUI script...

I'm using it to toggle my SFX on and off in my game menu options

I've managed to set up the UI toggle to toggle my sprites but I need this toggle switch to be saved throughout my game....

I have a script set up through the UIbutton script and when pressed it turns off my SFX and this saves throughout the game but when I return to a level the sprites have reset and it does not sync with the sfx being turned off...

If any one could help I'd appreciate that very much,

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle Button
« Reply #1 on: July 10, 2014, 09:25:02 PM »
Attach UISavedOption script to your toggle and give it a key, and it will be saved.

virginsteele

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIToggle Button
« Reply #2 on: July 11, 2014, 04:01:56 AM »
Hi thanks for the response, where do I find the UISavedOption script, my NGUI menu doesnt seem to have it?

Also, do I add it to the same game object as the toggle script or do I link it to the toggle script itself somehow?

Thanks very much for the help

virginsteele

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIToggle Button
« Reply #3 on: July 11, 2014, 04:04:23 AM »
Hi,

Nevermind I found the script, what do it put in the key area?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIToggle Button
« Reply #4 on: July 11, 2014, 08:11:06 PM »
Some unique key you want it saved as. For example "Login Name".