惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
T
Tailwind CSS Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
云风的 BLOG
云风的 BLOG
C
Cybersecurity and Infrastructure Security Agency CISA
O
OpenAI News
Recorded Future
Recorded Future
GbyAI
GbyAI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Y
Y Combinator Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
量子位
博客园 - 叶小钗
V
Vulnerabilities – Threatpost
F
Full Disclosure
Recent Announcements
Recent Announcements
Vercel News
Vercel News
S
Schneier on Security
H
Heimdal Security Blog
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
B
Blog RSS Feed
宝玉的分享
宝玉的分享
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
G
Google Developers Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
N
Netflix TechBlog - Medium
S
Security @ Cisco Blogs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone

博客园 - _Sin

UnityGUI扩展实例:图片挖洞效果 Mask的反向实现 how to combine jpg + separate alpha in png? unity 全屏乱影 BlitMultiTap Unity Shader Billboard Unity Shaders Vertex & Fragment Shader入门 Unity3d三大光照渲染介绍 unity3d DefineManager 全局宏定义 Jenkins 搭建U3D自动发布 IOS Jenkins 搭建U3D自动发布 Android Color Space Max批量导出工具 手游比重 不得不存!UI设计新手不可错过的7条实用法则 Unity3D游戏在iOS上因为trampolines闪退的原因与解决办法 unity3d ngui 字体制作 工具与示例 幽默的理解六种Socket I/O模型 Unity3d Socket C# sourecode Flex与c# Socket通信 C# 解析JSON数据格式 Mono 源码
[Unity3D]引擎崩溃、异常、警告、BUG与提示总结及解决方法
_Sin · 2013-07-19 · via 博客园 - _Sin

此贴会持续更新,都是项目中常会遇到的问题,总结成贴,提醒自己和方便日后检查,也能帮到有需要的同学。

若各位有啥好BUG好异常好警告好崩溃可以分享的话,请多多指教。xuzhiping7#qq.com。

1.U3D经常莫名奇妙崩溃。

一般是由于空异常造成的,多多检查自己的引用是否空指针。

2.编码切换警告提示。

警告提示:Some are Mac OS X (UNIX) and some are Windows.

This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

编码格式问题,VS的话直接高级保存方案里面修改,一般我选的是UNICODE(UTF8代签名)MACINTOSH(CR),WINDOW下的可以选WINDOWS的格式,两边都要用的话,推荐选CR。

BUG:IOS下,游戏中的中文显示乱码。

解决方式:同上,修改改代码页的编码。UNICODE(UTF8代签名)MACINTOSH(CR)

3.中文界面解决问题。

monodevelop中文显示解决方法:

http://www.cocoachina.com/bbs/read.php?tid-78563.html

中文Mac系统下MonoDevelop乱码解决:

http://blog.csdn.net/ssihc0/article/details/6796118

4.安装空项目报错

不知道怎么地,在IOS试过一次空项目也在错误提示。大概是说什么“找不到需要的方法”。

重装一下就好了,估计是UNITY文件损坏或者安装不完全出错了。重装吧。

错误提示:MissingMethodException: Cannot find the requested method.

估计是破解U3D造成的,该破解文件可能是不支持WIN7下的……

解决方法:

1、换正版。

2、换个破解文件。

5.平台编译错误或库引用缺失

错误提示:error CS1061: Type `System.IO.FileInfo' does not contain a definition for `Delete' and no extension method `Delete' of type `System.IO.FileInfo' could be found (are you missing a using directive or an assembly reference?)

出了这个错误一般有两个原因了。

1.没有引用相关的库。

2.选错编译平台。(BuildSetting里面的Platform)

错误提示:Could not start compilationWin32Exception:ApplicationName="XXXX\mono.exe",……

[Unity3D]引擎崩溃、异常、警告、BUG与提示总结及解决方法

解决方式:重装UNITY3D。

6.内存资源加载错误问题

错误提示:Trying to reload asset from disk that is not stored on disk

个人是在加载多个ASSETBUNDLE时,用了释放镜像之后,发生了下面的BUG。

这个警告它并没有对游戏流程有任何影响,不过一直跳出来很烦人。我们项目中是因为用Dictionary删除的时候没有删除完整导致的。

解决方案参考:http://blog.sina.com.cn/s/blog_5b6cb95001019ipi.html

个人认为比较大可能是下面的原因:

还没释放完镜像再次加载就出BUG了。将所有ASSETBUNDLE加载完后再同一释放,这样就没问题了。

Unity will only allow you to have a single instance of a particular AssetBundle loaded at one time in your application. What this means is that you can't retrieve an AssetBundle from a WWW object if the same one has been loaded previously and has not been unloaded. In practical terms it means that when you try to access a previously loaded AssetBundle like this:

(BY :http://docs.unity3d.com/Documentation/Manual/keepingtrackofloadedassetbundles.html)

查阅了一下,貌似还有别的问题能导致这提示。下面是相关可以继续深入的资料,可以帮助大家理解U3D的加载和内存管理:

百度搜一下下面两篇文章,应该是出自圣典论坛:

1.【全面理解Unity加载和内存管理】

2.【全面理解Unity加载和内存管理机制之二:进一步深入和细节】

国外论坛的讨论:

http://forum.unity3d.com/threads/49298-Trying-to-reload-asset-from-disk-that-is-not-stored-on-disk

貌似老外也没完全确切搞定这个。

错误提示:Deleting persistent object without writing it first

不论如何你都不应该直接修改一个从assetbundle加载进来的最初数据,一般都要先实例化出来再对其修改。但是引用的东西(例如mesh),这些也不能修改它。若要修改的话,则先复制一份出来。

//复制一份模型出来重新复制,以免直接修改被引用的镜像模型。如下:

Mesh temp = Mesh.Instantiate(smr.sharedMesh) as Mesh;

myMesh.sharedMesh = temp;

7.时间错误、NaN错误

错误提示:transform.position assign attempt for 'XXX' is not valid。Input rotation is {NaN, NaN, NaN, NaN}.

一般是由于游戏暂停将timescale设为0引起的,需要寻找相应用了Time.deltTime等参数的函数修改。否则会导致计算出错报空异常。

详细解决看另一篇文章:

关于NaN(Not a Number)的问题 

8.动画错误

这个错误是4.0新引进动画系统才出现的。

错误提示:Mecanim: BindSkeleton: Cannot find transform"objectname"

解决方式:

1.找到该对应transform"objectname"的模型,直接在检索面板搜索所有相应名字,能容易找到。

2.将模型的面板的Rig部分的动画AnimationType改为none

9.坐标系向量计算的错误提示

错误提示:Look rotation viewing vector is zero

解决方式:一般是由于摄像机的旋转角度造成的。也可能是向量的计算多余而系统提示。我们项目中是强制摄像机90度的时候出现,改成89.9度就没问题了。

具体还有的参考U3D官方论坛:

若没找到解决方法再搜索下。

10.关于AssetServer

错误:明明上传了所有修改,但是别人的机子却没有下载带最新代码。

原因:Merge完代码之后,操作了ignore server change,UNITY默认是以你本机子的为准,若此代码没有再次修改,则AssetServer不认为这个东西被修改过,没有上传那代码。

解决方式:打个空格重新保存一下该代码。

11.关于数据格式的错误

错误提示:Illegal JSON sequence

12.导出WINDOS平台下的项目运行不成功

错误提示:没有找到相应assetbundle的路径

解决方式:因为用了assetbundle加载,而游戏在有中文路径下,assetbundle的路径不能有中文。换个无中文的目录即可。从根源上能解决的方案现在暂时没有。

13.导入资源出错

错误提示:Error while importing package :Couldn't decompress package

解决方式:导入资源出错,大部分都是中文路径惹的祸。将资源换到无中文路径试试。如C/D盘根目录。