C# 如何统一使用集合数据结构?

C# 如何统一使用集合数据结构?,c#,unity3d,C#,Unity3d,我正在使用Unity并用notepad++编写C脚本。 有人能告诉我如何使用set数据结构吗?或者,一般来说,可以给我一些文档,在这些文档中,我可以找到有关数据结构的详细信息,比如优先级队列,我可以在unity中使用C脚本 我用的是 SortedSet my_Set1 = new SortedSet(); 错误是: error CS0246: The type or namespace name `SortedSet' could not be found. Are you missing a

我正在使用Unity并用notepad++编写C脚本。 有人能告诉我如何使用set数据结构吗?或者,一般来说,可以给我一些文档,在这些文档中,我可以找到有关数据结构的详细信息,比如优先级队列,我可以在unity中使用C脚本

我用的是

SortedSet my_Set1 = new SortedSet();
错误是:

error CS0246: The type or namespace name `SortedSet' could not be found. Are you missing an assembly reference.

好了,现在问题解决了。问题在于脚本运行时版本。将脚本运行时版本更改为.Net.4.x是可行的

以下是步骤-

编辑->项目设置->播放器设置->其他设置->配置->脚本运行时版本


并将其更改为.Net 4.x

可能与我更改了标签的内容相同,谢谢。可能需要结帐,只需使用您的案例所需的结构即可。。不要放弃在脚本using System.Collection.Generic的顶部包含using语句;我发现问题出在脚本运行时版本上。