- Home /
saving class array states
I wrote a script that contains a series of class arrays that the user can make adustments to through some OnGUI
buttons. After the user has made a change, I would like that to be recorded and saved, so that the modified values can be called back.
I'm having some trouble getting my head around how I could best save this information and how it would then be called back when needed. I'm writing this in javascript so that always helps - thx!
I forgot to mention in my original question that this script is assigned to several game objects, each having their own set of values.
$$anonymous$$nowing this would it be better to just save each array, or maybe it would be more efficient to create another array for all of the script instances? Is there a limit to the depth of an array?
Answer by Julian-Glenn · Aug 11, 2010 at 06:32 PM
PlayerPrefs could prolly do it if it is not a huge amount of data to save.
http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613071007im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WARNING : Assignment to temporary. 1 Answer
How to get keyboard/controller state? 1 Answer
Script wont read array 2 Answers
JSON missing arrays 1 Answer
adding classes to arrays 2 Answers