Jon Michael Jubelag
Jon Michael Jubelag

Reputation: 23

List in a List?

I need to create a generic list that contains list of gameobjects in Unity.

var gameObjectList:List.<List.<GameObject>> = new List.<List.<GameObject>>();

but I am getting errors about the syntax. I rather not use an Array which I have to type-cast. Can anybody point me to the right direction?

Upvotes: 2

Views: 236

Answers (1)

Bart
Bart

Reputation: 20038

That is a simple matter of spaces. One of the first errors you get (and it will get worse after that) is something like:

BCE0044: expecting >, found '>>'.

Change the line to

var gameObjectList:List.< List.<GameObject> > = new List.< List.<GameObject> >();

and all should be well.

Upvotes: 1

Related Questions