I have the following code:
static int gridX = 40;
static int gridY = 40;
public struct CubeStruct
{
public Transform cube;
public bool alive;
public Color color;
}
public CubeStruct cubeArray[,] = new CubeStruct[gridX, gridY];
This returns the following errors:
error CS1519: Unexpected symbol `,’ in class, struct, or interface
member declarationerror CS0178: Invalid rank specifier: expected
,' or]’error CS1519: Unexpected symbol `;’ in class, struct, or interface
member declaration
It’s probably something obvious, but I can’t see it.
In C#, the
[,]go before the name of the variable (i.e. it is not like in C/C++).