- Home /
Question by
IGPatty · Jan 02, 2013 at 07:15 AM ·
playerprefsdatacontinue
If the game has registered a PlayerPrefs then some code will happen
Hi Guys,
I need some help writing a script which will execute some code if the game has registered some data being saved in a PlayerPrefs.
So if some data has been saved by PlayerPrefs (such as camera location) then the color of some text will change from gray to white otherwise it will stay gray.
The code will be for a 'continue' button that will only be available (be white font) when the player has actually made some progress.
That progress will be saved in a PlayerPrefs class.
Thanks and Regards, Paddy
Comment
Answer by Julien-Lynge · Jan 02, 2013 at 06:54 PM
You can use HasKey to check if a value has been set: http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.HasKey.html