I've tried using the generic list but my research said that the enumerator for the List could not be reset so that wont do since I need to iterate continuously over a list of float [,].
I essentially want to cache 10 different perlin noise maps that the game loop iterates over. Each perlin map is a float [,]. All maps are of same width and height.
I want to store these in some datastructure that I can continously iterate over, be it generic list or an array:
void BuildCache() {
cache = new float[cacheSize][,];
for(int i = 0; i < cacheSize; i++) {
float[,] noiseMap = Noise.GenerateNoiseMap (width, height, seed, noiseScale, octaves, persistence, lacunarity, offset);
cache [i] [0] = noiseMap;
offset += speed;
}
}
This results in this error: Assets/Scripts/FogGenerator.cs(51,36): error CS0022: Wrong number of indexes 1' inside [], expected
2'
It seems like a basic thing, in Java I would use a generic list but since I can't reset C#'s generic list I'm at a loss here.