【发布时间】:2015-07-07 03:01:09
【问题描述】:
我有以下代码
public Dictionary<int[], string> worldMap = new Dictionary<int[], string>();
for (int x=0; x <= 10; x++) {
for (int y=0; y <= 10; y++) {
int[] cords = new int[]{x,y};
worldMap.Add(cords, "empty");
}
}
如何从这本字典中获取值?
【问题讨论】:
-
世界地图[new int[]{1,1}]
-
你不能把 Dictionary
改成 Dictionary 吗? -
我尝试了 Debug.Log(worldmap(new int[]{1,1})),但它不允许我运行它。当我尝试 Debug.Log[worldmap(new int[]{1,1})] 时,它说找不到密钥
-
不,我不能,我特别需要它,所以我不能在字典中输入坐标,它会给我那个区域的地形类型
标签: c#