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

Why are my MRTK Buttons in Unity just Pink?

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

这些是我安装的插件:

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

我想可能是我没设置过,但我比较没经验。我可以做进一步的故障排除吗?

附录:我在控制台中收到一条无法删除的错误消息。 (它甚至在新创建的项目中仍然存在):

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 功能工具安装程序测试版安装了没有资产的包,就像 Github 存储库中的 Unity 包一样。 这导致了错误。只需直接从 Github 存储库安装 Unity 包即可。

进一步阐述: 如果最大,则包不会被 mrtk 功能工具导入。子文件夹的字符串长度超过 255。这是一件非常烦人的事情,因为您必须将项目基本上保存在驱动器的根目录中。