您的位置:首页 > 移动开发 > Unity3D

Unity5.x 资源加载Bug

2016-08-16 16:06 218 查看
做一次做项目的时候, 将Unity4.x版本的游戏升级到Unity5.x后,资源打包需要从新做。(这块内容后期会写一个专门的题材),从新做完后,加载资源的时候界面都正常加载了,但是Editor 加载完界面报错,错误代码如下:

The referenced script on this Behaviour(GameObject ‘SystemChannelB’) is missing!

A script behaviour(script unknown or not yet loaded)has a different serialization layout when loading.(Read 32 bytes but expected 56 bytes) Did you #iddef UNITY_EDITOR a section

of your serialized properties in your scripts?

Prefab has mulitiple Transform components! removing them automatically would not be safe

GameObject(named ‘SystemChannelB’)references runtime script in scene file.Fixing!

经过了大概三天的调试,和查找,终于把则这个问题解决了。

就是SystemChannelB 这个组建其实是没有的,但是在打包前这个组建存在,打包后这个组建被删除了,所以加载的时候,资源会找这个组建,导致报错如上。

解决方法:

将包含这个组建的预制体里面的这个组件删除,然后保存,然后冲洗打包成AssetBundle 。这样就可以解决问题。

百度和google 了很多这样类似的问题, 再次提高类型解决方案

http://answers.unity3d.com/questions/997644/gameobject-references-runtime-script-in-scene-file.html?page=3&pageSize=5&sort=votes

希望可以帮到大家。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  unity bug