Hello I do not know why it is impossible for me to complete my collection of objects declared just before.
Here is my declaration a list of a list of objects. (I want to store the list of objects in a reference list):
private List<List<Classes.instancedModel>> listInstance;
I initialize in the constructor
listInstance = new List<List<Classes.instancedModel>>();
I initialize the first array of my list before completing my list in a loop but i can not…
listInstance[0] = new List<Classes.instancedModel>();
listInstance[0].Add(new instancedModel(1, position_model_origin, new Vector3(0, 0, 0), 1, Game));
But I will throw an exception of type: ArgumentOutOfRangeException
Can someone explain to me how to declare two dynamic list and fill the fly as my example? with a list into a list
A list isn’t an array. You may not access with the indexer unless there’s at least an item.