【发布时间】:2021-07-29 00:59:07
【问题描述】:
我为我尝试为 Hololens 2 开发的应用程序的场景添加了一些 MRTK 工具箱按钮,但这些按钮始终是粉红色的。不过它们是可点击的。
这些是我安装的插件:
我为了让它们工作而尝试过的事情(我总是导入建议的 Textmesh Pro 文件):
- 围绕构建平台切换
- 启用所有 Windows Mixed Reality 平台功能
- 尝试在 Unity 2019.4.24f1 和 Unity 2020.3.1f1 上创建新项目
- 已删除库文件夹
我想这可能是我没有设置的设置,但我很缺乏经验。我还能做进一步的故障排除吗?
附录:我在控制台中有一条我无法摆脱的错误消息。 (即使在新创建的项目中也存在):
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Projekte\MyHololens\poc-3d-visualisierung-hololens\ButtonTest\Library\PackageCache\com.microsoft.mixedreality.toolkit.foundation@5db3df152788-1616077456490\SDK\Experimental\InteractiveElement\Examples\Scripts\CustomStateExample\KeyboardState'.
at System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.FileSystemEnumerableIterator`1[TSource].CommonInit () [0x00054] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.FileSystemEnumerableIterator`1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler`1[TSource] resultHandler, System.Boolean checkHost) [0x000d6] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00009] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.Directory.InternalGetFiles (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.Directory.GetFiles (System.String path, System.String searchPattern) [0x0001c] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.DirectoryInfo.GetFiles (System.String searchPattern) [0x0000e] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x00002] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFilesSubdirs(System.Collections.ArrayList,string)
at System.IO.DirectoryInfo.GetFilesSubdirs (System.Collections.ArrayList l, System.String pattern) [0x0002f] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.IO.DirectoryInfo.GetFiles (System.String searchPattern, System.IO.SearchOption searchOption) [0x00017] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo.GetFiles(string,System.IO.SearchOption)
at Microsoft.MixedReality.Toolkit.Utilities.Editor.OnLoadUtilities.FindShaderFolderInPackage () [0x0005f] in C:\Projekte\MyHololens\poc-3d-visualisierung-hololens\ButtonTest\Library\PackageCache\com.microsoft.mixedreality.toolkit.standardassets@de5423dc1456-1616077455335\EditorUtilities\OnLoadUtilities.cs:152
at Microsoft.MixedReality.Toolkit.Utilities.Editor.OnLoadUtilities.EnsureShaders (System.Boolean bypassIgnore) [0x00001] in C:\Projekte\MyHololens\poc-3d-visualisierung-hololens\ButtonTest\Library\PackageCache\com.microsoft.mixedreality.toolkit.standardassets@de5423dc1456-1616077455335\EditorUtilities\OnLoadUtilities.cs:42
at Microsoft.MixedReality.Toolkit.Utilities.Editor.OnLoadUtilities..cctor () [0x00001] in C:\Projekte\MyHololens\poc-3d-visualisierung-hololens\ButtonTest\Library\PackageCache\com.microsoft.mixedreality.toolkit.standardassets@de5423dc1456-1616077455335\EditorUtilities\OnLoadUtilities.cs:23
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])
【问题讨论】:
-
看起来材质上的“着色器”有误。由于我自己没有使用过 MRTK,我不能多说,但这看起来像是一个解决方案:Migrating to MRTK2: Mixed Reality Toolkit Standard Shader 'Breaks'
-
字段显示为灰色,但我注意到似乎在每个项目中都会再次出现的错误消息,即使它是新的。我将其添加到问题中
-
Pink 总是在着色器中出现错误...错误:尝试删除库并让 unity 在下次启动时重建它.. 通常这仅在将现有项目升级到较新项目时发生Unity 版本.. 还要确保您使用的 MRTK 版本支持您使用的 Unity 版本
-
很遗憾,清除库不起作用。错误保持不变
标签: unity3d mrtk windows-mixed-reality