|
Can Unity webplayers save data to the user's local PC, in the same way that Flash SWFs can save data using the actionscript "sharedObject" class, and that browser-based javascript can save data using cookies? (the functions used to do this in Unity have been mentioned in a number of other answers on this site, but not specifically in the context of their equivalence to the Flash and Browser cookie functions used to save data).
(comments are locked)
|
|
Yes, web-based Unity content can save data to the local machine using the PlayerPrefs class. Each webplayer url can save up 1 megabyte of data, consisting of either ints, floats or strings. For example:
And the commands are very similar for floats and strings:
You can also query the player prefs data to see whether a certain key has been set, using PlayerPrefs.HasKey, and delete keys using either PlayerPrefs.DeleteKey or PlayerPrefs.DeleteAll. Looks handy. What about in the standalone versions?
Dec 01 '10 at 12:28 PM
Bill 2
Works just the same in standalone builds!
Dec 01 '10 at 01:08 PM
duck ♦♦
was just about to reply to my own comment and say the same thing. works great. Thanks
Dec 01 '10 at 01:23 PM
Bill 2
(comments are locked)
|
