So, I a game where it would be ideal to call up characteristics from a pre-defined list, such that if I have GameObject1, I can go to Array[1,2], Array[1,3], etc to pull out its characteristics.
That said, I do not know #1 how to do this (does unityscript have a 2d array function?) and #2 how I can save this information in say, the editor, so I don't have a script in mono that is essentially unnecessary load times seeing as it would never change during runtime. Are there any solutions available in unity for this? Or if not, what is the best work-around?
In order to save the data outside of runtime, you'd have to set up an editor script to collect the data and save it to disk (perhaps in an xml document in Resources) OR set up a custom EditorGUI that would allow you to enter the data as a series of one-dimensional arrays, or other equally exotic solutions.
That being said, if you're really set on manually setting up the array from the editor you probably want to simply flatten the array to be one dimensional (and make sure it's public) and then convert it to a 2d array at runtime (the cpu time to copy an array of pointers at runtime will be absolutely trivial, on the order of nanoseconds).
answered Sep 29 '11 at 05:17 AM