为什么我在 Unity 中的 MRTK 按钮只是粉红色?

问题描述

我在我尝试为 Hololens 2 开发的应用程序的场景中添加了一些 MRTK 工具箱按钮,但这些按钮始终为粉红色。不过它们是可点击的。

enter image description here

这些是我安装的插件:

enter image description here

为了让它们工作而尝试的事情(我总是导入建议的 Textmesh Pro 文件):

  • 切换构建平台
  • 启用所有 Windows 混合现实平台功能
  • 尝试在 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.Boolean includeFiles,System.Boolean includeDirs,System.Boolean checkHost) [0x00009] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.IO.Directory.InternalGetFileDirectoryNames (System.String path,System.String userPathOriginal,System.Boolean checkHost) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.IO.Directory.InternalGetFiles (System.String path,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,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[])

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)