[英]the type or namespace name 'mixedreality' does not exist in the namespace 'microsoft' (are you missing an assembly refrence?)
I am currently developing an app for the Hololens 2 with Unity and mrtk.我目前正在使用 Unity 和 mrtk 为 Hololens 2 开发应用程序。 I am trying to get the Gaze direction from the GazeProvider.cs which is attached to the camera, because i want to spawn objects in front of the players face.我正在尝试从连接到相机的 GazeProvider.cs 获取 Gaze 方向,因为我想在玩家面前生成物体。 I am trying to access it like the mrtk site states:我正在尝试像 mrtk 网站所述访问它:
void LogGazeDirectionOrigin()
{
Debug.Log("Gaze is looking in direction: "
+ CoreServices.InputSystem.GazeProvider.GazeDirection);
Debug.Log("Gaze origin is: "
+ CoreServices.InputSystem.GazeProvider.GazeOrigin);
}
However when trying to using Microsoft.MixedReality.Toolkit;
但是,当尝试using Microsoft.MixedReality.Toolkit;
the error错误
the type or namespace name 'mixedreality' does not exist in the namespace 'microsoft' (are you missing an assembly refrence?)命名空间“microsoft”中不存在类型或命名空间名称“mixedreality”(您是否缺少程序集引用?)
occurs.发生。 Therefore CoreServices is also not recgonized.因此 CoreServices 也没有被认可。 Also i recognised, that the GazeProvider.cs hat this path in the package folder Packages/com.microsoft.mixedreality.toolkit.foundation/Services/InputSystem/GazeProvider.cs .我还认识到,GazeProvider.cs 在包文件夹Packages/com.microsoft.mixedreality.toolkit.foundation/Services/InputSystem/GazeProvider.cs中有这个路径。 I don't know how to fix this or how to access the gaze direction of the player, i have been searching for a while now.我不知道如何解决这个问题或如何访问玩家的注视方向,我一直在寻找一段时间。
I would appreciate some help, thanks!我会很感激一些帮助,谢谢!
Thanks for the answers, but it unfortunately did nothing for me.感谢您的回答,但不幸的是它对我没有任何帮助。 I had to create a complete new project and migrated some prefabs i used there.我必须创建一个完整的新项目并迁移我在那里使用的一些预制件。 Something with the Assemblies was broken and not created right.组件的某些东西被破坏并且没有正确创建。 Some of the mrtk packages probably generated new assamblies, but i do not know which one.一些 mrtk 包可能会生成新的组件,但我不知道是哪一个。
Hi I'm Wayne Wang from the Microsoft for Founders Hub team!大家好,我是 Microsoft for Founders Hub 团队的 Wayne Wang!
Here is my suggestion:这是我的建议:
after the setting was saved, the pacakge you referenced may create new projects in your project of C#.保存设置后,您引用的 pacakge 可能会在您的 C# 项目中创建新项目。 These projects actually can be references of your current major project.这些项目实际上可以作为您当前主要项目的参考。 The errors should be gone by then.到那时,错误应该消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.