我正在尝试在 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 中不起作用?