Iterating through a layered loop:
//earlier
obj = Instantiate (aPrefab,new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
BBBBBBList.Add (obj);
//later
for (i = 0; i < AAAAAList.Count; i++) {
//stuff with A list
for (n = 0; n < BBBBBBList.Count; n++) {
someObject = BBBBBBList[n]; //null
}
}
a and b list are both filled with instances generated in editor mode. Worked fine as runtime. Is there some gotcha for instancing copy’s in editor mode?
EDIT: List B of gameObjects is null. But list count is correct.
Im begining to think this is the issue for some reason in an editor script only, returning the wrong type or something to the list, maybe editoronly bug? Strange because I use snippet below for other prefab objects in list A and those are not null.
obj = Instantiate (aPrefab,new Vector3(0, 0, 0), Quaternion.identity) as GameObject;
BBBBBBList.Add (obj);