gpt4 book ai didi

c# - 更新到 Unity 2019.3 后无法编译 Unity WebGL

转载 作者:行者123 更新时间:2023-12-02 10:41:04 34 4
gpt4 key购买 nike

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

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

最佳答案

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

我发现删除包有效,因为没有人使用它,我不知道为什么 Unity 甚至安装了它。如果我使用这个包,虽然我不知道我会做什么。

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

关于c# - 更新到 Unity 2019.3 后无法编译 Unity WebGL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60066964/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com