x


Saving/Loading variables

I'm making a game that uses an array to keep track of which levels have been completed, and which haven't. My question is, how do you save the array so that the next time the player plays my game (online), the array is called back into existence and the player doesn't have to do those levels again? Also, while I don't need it in Javascript, it'd be nice since that's what I use. Thanks!

more ▼

asked Jun 18 '10 at 01:29 PM

Cosine gravatar image

Cosine
23 1 1 5

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Check this script on the wiki:

http://www.unifycommunity.com/wiki/index.php?title=ArrayPrefs

It'll let you persist your own int, string etc arrays very easily

more ▼

answered Jun 18 '10 at 01:37 PM

Mike 3 gravatar image

Mike 3
30.5k 10 65 253

PlayerPrefsX is obsolete.

Jun 18 '10 at 02:25 PM Cosine

PlayerPrefsx is obsolete, ArrayPrefs/PlayerPrefsX (different capitalization on the X) isn't

Jun 18 '10 at 03:17 PM Mike 3

How would I go about implementing this? I'm trying "PlayerPrefsX.SetIntArray(arguments)" and Unity gives me errors about unknown identifiers. The code is also not picked up by the syntax highlighting.

Jun 18 '10 at 05:06 PM Cosine

make sure you put the script(s) from the page into one of the earlier compilation pass folders, e.g. Plugins

Jun 18 '10 at 05:43 PM Mike 3

Alright, thanks! I got it working now.

Jun 18 '10 at 06:24 PM Cosine
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1358
x821
x436
x436
x126

asked: Jun 18 '10 at 01:29 PM

Seen: 2833 times

Last Updated: Jun 18 '10 at 01:29 PM