小编use*_*769的帖子

无法在 Unity 中使用 C# .NET 6 PriorityQueue

我正在尝试在 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)

但返回一个错误:

The type or namespace name 'PriorityQueue<,>' could not be found (are
you missing a using directive or an assembly reference?)
[Assembly-CSharp]
Run Code Online (Sandbox Code Playgroud)

我检查了 VS Code 中的 .NET 版本: 在此输入图像描述

为什么它在 Unity 中不起作用?

c# priority-queue unity-game-engine .net-6.0

7
推荐指数
1
解决办法
8057
查看次数

标签 统计

.net-6.0 ×1

c# ×1

priority-queue ×1

unity-game-engine ×1