Array of String[] Arrays?

Ok the other thread I made was kind of confusing. What I’m trying to accomplish is an Array of String[ ] Arrays that I can edit the size of in the inspector, how would I go about making something like that?

Multidimensional arrays were added to Javascript in 3.2 (I don’t recall when C# got them, if they weren’t there all along). They’re delcared like so:

var arrayOfArrayOfString : String[,] = new String[5,10];

In this case you’d have five arrays of String[ ], each of which holds 10 strings. You access it with something like

var testString : String = arrayOfArrayOfString[0, 2];

Unfortunately, multidimensional arrays aren’t serialized in the Inspector. If you want to be able to edit them there, I’d recommend making a custom class that doesn’t extend MonoBehaviour with the Serialize attribute that just contains a String array.

class StringArray extends System.Object {
    var strings : String[];
}

And keep an array of StringArray objects in your primary class. If you’d rather work with a multidimensional array once your game has started, you can copy it into one in Awake or Start.

Thanks, exactly what I was looking for!