更新至Unity 2019.3后无法编译Unity WebGL

问题描述 投票:0回答:1

我有一个Unity 2019.2项目,我刚刚更新到Unity 2019.3,打开该项目时编辑器中没有错误,我什至可以以.exe格式构建到Windows设备。因此,我开始开发一些功能,一切都很好,它仍然可以在Windows上构建。因此我尝试将平台切换为WebGl。一切似乎都很好,我什至可以运行我的项目。但是,一旦我按下build键,就会收到以下错误:(每个错误都由一行分隔)

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.2\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(185,13): error CS1069: The type name 'PoseData' could not be found in the namespace 'UnityEngine.XR.Tango'. This type has been forwarded to assembly 'UnityEngine.ARModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'AR' in the Package Manager window to fix this error.

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.2\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(186,17): error CS0103: The name 'TangoInputTracking' does not exist in the current context

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.2\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(186,91): error CS0103: The name 'PoseStatus' does not exist in the current context

Error building Player because scripts have compile errors in the editor

Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00275] in <6f28216fea9f453abf2e05b770ed3ee4>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <6f28216fea9f453abf2e05b770ed3ee4>:0 
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

尝试在WebGL中进行构建后,我将无法再在编辑器中运行该项目,但是,如果将平台切换回Windows,该错误将消失,并且我可以在编辑器中运行该项目,甚至可以针对Windows进行编译。但是切换回WebGL并尝试编译会再次破坏它。

它似乎与Unity 2019.3现在基于软件包的方式有关,但是我无法确定这是UI问题,输入系统问题还是其他无数个问题。其他人可以破译错误并提供解决方案吗?

编辑:在程序包管理器中尝试更新Unity XR之后,我现在收到以下错误,这次错误出现只是在切换平台而不是为其构建时:

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.6\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(188,13): error CS1069: The type name 'PoseData' could not be found in the namespace 'UnityEngine.XR.Tango'. This type has been forwarded to assembly 'UnityEngine.ARModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'AR' in the Package Manager window to fix this error.

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.6\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(189,17): error CS0103: The name 'TangoInputTracking' does not exist in the current context

Library\PackageCache\com.unity.xr.legacyinputhelpers@2.0.6\Runtime\TrackedPoseDriver\TrackedPoseDriver.cs(189,91): error CS0103: The name 'PoseStatus' does not exist in the current context
c# unity3d compiler-errors unity-webgl
1个回答
1
投票

[一种或另一种更新到Unity 2019.3时,Unity似乎自动安装了一个名为“ XR Legacy Input Helpers” See Reference Image的软件包,我尝试通过打开软件包管理器来更新软件包,但这只是引起了更多错误。

我发现删除软件包是可行的,因为没有人使用它,我也不知道为什么Unity会安装它。如果我使用此程序包,尽管我不知道该怎么办。

感谢@BugFinder&和@Ankit帮助我找到解决问题的方法。

热门问题
推荐问题
最新问题