Unity错误CS0246(找不到命名空间)

时间:2019-09-14 01:10:33

标签: c# visual-studio unity3d hololens

我正在尝试遵循本教程:

https://www.freecodecamp.org/news/how-to-create-your-first-hololens-app-with-unity-1afa364843d4/

创建脚本尝试旋转多维数据集后,Unity中出现错误:

Licensing Fee for Google Cloud Dataproc (CPU cost)

这是它中断的代码行:

Assets\InteractiveCube.cs(4,7): error CS0246: The type or namespace name 'HoloToolkit' could not be found (are you missing a using directive or an assembly reference?)

我已经下载了最新版本的Mixed Reality Toolkit。我正在使用Unity 2018.4.8f1和Visual Studio。

如果您遇到此问题并知道如何解决,请告诉我!如果您知道完成相同任务的替代方法,我也想知道!

1 个答案:

答案 0 :(得分:1)

在Holotoolkit更新到MRTKv2之后,名称空间已更改,并且MRTKv2与HoloToolkit不兼容。现在,您需要调用的API在命名空间Microsoft.MixedReality.Toolkit中。您可以在以下链接中搜索满足您需要的API:https://microsoft.github.io/MixedRealityToolkit-Unity/api/Microsoft.MixedReality.Toolkit.html

如果您坚持使用Holotoolkit,请单击此链接下载以前的版本: https://github.com/microsoft/MixedRealityToolkit-Unity/releases/tag/2017.4.3.0-Refresh

此外,对于最新的MRTK,建议您阅读最新的Microsoft文档:https://docs.microsoft.com/en-us/windows/mixed-reality/mrlearning-base-ch1https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/GettingStartedWithTheMRTK.html

相关问题