找回密码
 立即注册
查看: 255|回复: 0

Unity PrefabStageUtility在Mac打包报错

[复制链接]
发表于 2022-7-26 09:13 | 显示全部楼层 |阅读模式
环境说明

打包机马蜂窝
UnityUnity2021.3.5f1
测试情况

本地电脑环境
打包环境Win10 台式
UnityUnity 2021.3.5f1
测试结果,打包没有问题,能正常出Android和Win的ab,输出也能正常运行!
问题

但是在提交到CI出包的时候,遇到以下的error:
##### Output
UGUIViewElementsRegistryUtils.cs(15,31): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
UGUIViewElementsRegistryUtils.cs(32,77): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
UGUIViewElementsRegistryInspector.cs(34,35): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
UGUIViewElementsRegistryBuilder.cs(15,35): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
UGUIViewElementsRegistryUtils.cs(128,31): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
UGUIViewElementsRegistryUtils.cs(243,47): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
*** Tundra build failed (12.54 seconds), 1204 items updated, 1422 evaluated
##### Output
CreateCorrespondingLuaFiles.cs(16,31): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)
CreateCorrespondingLuaFiles.cs(26,35): error CS0234: The type or namespace name 'PrefabStageUtility' does not exist in the namespace 'UnityEditor.Experimental.SceneManagement' (are you missing an assembly reference?)而且也有不少人遇到的!
https://forum.photonengine.com/discussion/18715/prefabstageutility-does-not-exist-in-the-namespace-unityeditor-experimental-scenemanagement
解决方法

在代码里不要使用
UnityEditor.SceneManagement.PrefabStageUtility
如果代码一定要使用这个类,就按照下面的形式来使用
using UnityEditor.SceneManagement;
...

PrefabStageUtility.XXXX这样在打包的时候就不会报错了! 估计是和dll中的MovedFrom有关!
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-11-15 12:58 , Processed in 0.089553 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表