Hello there,
for reasons I need a List of Vector2-Lists:
List<List<Vector2>> occludedObjects;
void someInitFunction(){
occludedObjects = new List<List<Vector2>>();
List<Vector2> occludedPoints = new List<Vector2> ();
occludedObjects.Add (occludedPoints);
}
Now when I add a new Vector2 to a sublist, every sublist will overwrite it’s content with this Vector2.
Clearing any sublist seems to clear the other sublists, too.
Here is how I’m trying to do things:
occludedObjects[0].Clear();
occludedObjects[0].Add (new Vector2(0f, 0f));
occludedObjects[0].Add (new Vector2(0f, 1f));
I guess I am missing some basic nested lists business
If this is not the source of the problem, i will try and dig deeper into my script.
Help (especially noob friendly) is very, very appreciated!