sil*_*fox 7 c# priority-queue unity-game-engine .net-6.0
我正在尝试在 Unity 中使用PriorityQueueC#。文档说它在 .NET 6 的命名空间中受支持System.Collections.Generic。
我试过了:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class Test : Monobehaviour
{
void Start()
{
var queue = new PriorityQueue<int, int>();
}
}
Run Code Online (Sandbox Code Playgroud)
但返回一个错误:
Run Code Online (Sandbox Code Playgroud)The type or namespace name 'PriorityQueue<,>' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]
为什么它在 Unity 中不起作用?
use*_*769 21
报告的版本dotnet与 Unity 的 C#/.NET 版本完全无关(至少在 Unity 最终从 Mono 迁移之前)。虽然支持的语言几乎等于 C# 9.0,但实际使用的库是 Mono 提供的松散超集,实际上大致等于 .NET Framework 4.8/.NET Standard 2.0 ATM;因为这两个都没有PriorityQueue,所以不可用。您可以:
| 归档时间: |
|
| 查看次数: |
8057 次 |
| 最近记录: |