关于代码

在update中如果想查找字典中的元素,最好这样写:


var enumerator = dictionary.GetEnumerator();

while (enumerator.MoveNext())

{

//enumerator.Current.Value

//enumerator.Current.Key

}

不要用foreach,应为低版本的unity用foreach会有GC产生,放在update里就大了。

你可能感兴趣的:(关于代码)