made an array of a custom class and i want to assign a prefab to class variable so assigning from another(inspector exposed) variable. relvent Code:
public class ChunkData {
public string BiomeName ="Forest";
public GameObject landType =null;
public GameObject[] NatureTypes =null;//list of nature placeables
public GameObject[] ObjList =null;//list if generated objects
public Object[] LoadedList;
public float worldX =0;//location in world in unity units
public float worldZ =0;//location in world in unity units
public int objDensity =100;
}
public class LandGenerator3 : MonoBehaviour {
public GameObject LandMesh =null;//land object(for now)
void Start () {
ChunkList = new ChunkData[worldSizeX, worldSizeZ];
void FillChunks(){
for (int x=0; x < worldSizeX; x++) {
for (int z=0; z < worldSizeZ; z++) {
ChunkList [x, z].landType = LandMesh ;**<<where i get error**
ChunkList [x, z].NatureTypes = NatureList;
ChunkList [x, z].objDensity = objDensity;
ChunkList [x, z].worldX = x * 50;
ChunkList [x, z].worldZ = z * 50;
CreateChunk(ChunkList[x,z],x,z);
print ("Chunk Filled?");
}
}
}