I think I am going crazy or I’m missing something.
I have the following Dictionary:
public Dictionary<int[,], InventorySlot> inventoryConatainer = new();
And here is my multi-dimensional array declaration:
[SerializeField] int rows;
[SerializeField] int columns;
private int[,] inventoryCell = new int[rows, columns];
And I want to initialise the Dictionary:
for(int i = 0; i < rows; i++)
{
for(int j = 0; j < columns; j++)
{
inventoryContainer.Add(inventoryCells[i,j], null);
}
}
inventoryCells[i,j] is highlighted saying Cannot convert from ‘int’ to ‘int[,]’
I’m not sure why inventoryCells[i,j] is understood to be an int. I’m using Visual Studio, so when I hover over inventoryCells[i,j] it’s type is shown to be int[,].
I’ve completely lost my train of thought because of this…