Unity3D性能消耗分析器.doc
《Unity3D性能消耗分析器.doc》由会员分享,可在线阅读,更多相关《Unity3D性能消耗分析器.doc(13页珍藏版)》请在咨信网上搜索。
1、分析器(仅专业版) Profiler (Pro only)Date:2012-02-25 04:56The Unity Profiler helps you to optimize your game. It reports for you how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating or in your game logic.Unity分析器可以帮助你优化你的游戏。它为
2、您报告在你的游戏的各个领域所花费的时间。例如,它可以报告渲染、动画或在你的游戏逻辑花费时间的百分比。You can play your game in the Editor with Profiling on, and it will record performance data. The Profiler window then displays the data in a timeline, so you can see the frames or areas that spike (take more time) than others. By clicking anywhere in
3、 the timeline, the bottom section of the Profiler window will display detailed information for the selected frame.在编辑器中,你可以将你的游戏在分析器运行着的状态下运行,它会记录性能数据。 分析器窗口,在时间轴上显示数据,所以你可以看到帧或区域峰值(比其他需要更多的时间)。在时间轴中的任何地方按一下,分析器窗口的底部区域会显示选定的帧的详细信息。Note that profiling has to instrument your code. This instrumentation
4、 has a small impact on the performance of your game. Typically this overhead is small enough to not affect the game framerate. When using profiling it is typical to consider only the ratio (or percentage) of time spent in certain areas. Also, to improve performance focus on those parts of the game t
5、hat consume the most time. Compare profiling results before and after code changes and determine the improvements you measure. Sometimes changes you make to improve performance might have a negative effect on frame rate; unexpected consequences of code optimization should be expected.请注意,分析时必须检测你的代码
6、。这检测会对你的游戏性能有小小影响。通常情况下,这种开销是足够小,不会影响游戏的帧率。当使用分析时,它是典型的考虑时间花费在某些领域的比例(或百分比)。此外,为了提高性能,重点在游戏消耗的时间最多的那些部分。代码更改前后比较分析结果,并确定您测量的改进。有时,您所做的更改来提高性能,可能对帧速率有负面影响;应预计代码优化的意外的后果。Profiler windowAttaching to Unity players 附加到Unity播放器To profile your game running on an other device or a player running on another
7、computer, it is possible to connect the editor to that other player. The dropdown Active Profiler will show all players running on the local network. These players are identified by player type and the host name running the player iPhonePlayer (Toms iPhone). To be able to connect to a player, the pl
8、ayer must be launched with the Development Build checkbox found in the Build Settings dialog. From here it is also possible to tick a checkbox to make the Editor and Player Autoconnect at startup.要分析你的游戏运行在其他设备上或者在另一台计算机上运行的播放器,可以连接编辑器到其他播放器。Active Profiler下拉菜单显示在本地网络上运行的所有播放器。这些播放器通过播放器的类型和运行播放器的主机
9、名iPhonePlayer(Toms iPhone)被识别。要能够连接到一个播放器,播放器必须在 Build Settings对话框中找到Development Build 复选框勾上的情况下打包生成。从这里也可以勾选一个复选框,使编辑器和播放器在启动时自动连接。Profiler Controls 分析器控件Profiler controls are in the toolbar at the top of the window. Use these to turn profiling on and off, navigate through profiled frames and so on
10、. The transport controls are at the far right end of the toolbar. Note that when the game is running and the profiler is collecting data clicking on any of these transport controls will pause the game. The controls go to the first recorded frame, step one frame back, step one frame forward and go to
11、 the last frame respectively. The profiler does not keep all recorded frames, so the notion of the first frame should really be though of as the oldest frame that is still kept in memory. The current transport button causes the profile statistics window to display data collected in real-time. The Ac
12、tive Profiler popup menu allows you to select whether profiling should be done in the editor or a separate player (for example, a game running on an attached iOS device).分析器控件在窗口顶部的工具栏。使用这些控件打开和关闭分析,浏览分析好的帧等。传输控件在工具栏的最右端。请注意,当游戏运行、分析器收集数据时,点击任何这些传输控件(那两个小箭头)将暂停游戏。控件转到记录的第一帧,一步一帧向前(左箭头),一步一帧向后(右箭头),分
13、别去到最后一帧。分析器不保留所有记录的帧,因此第一帧的概念,事实上应该是仍然保存在内存中的最旧的一帧。 current按钮会使得分析统计窗口显示实时采集的数据。激活分析器(Active Profiler)弹出菜单让你选择是否应在编辑器或一个或独立播放器进行分析(例如,一个游戏运行在iOS设备)。Deep Profiling 深度分析When you turn on Deep Profile, all your script code is profiled - that is, all function calls are recorded. This is useful to know wh
14、ere exactly time is spent in your game code.当你打开深度分析(Deep Profile),所有脚本代码将被分析 - 也就是说,所有的函数调用被记录。知道确切在你的游戏代码中花费的时间,这是有用的。Note that Deep Profiling incurs a very large overhead and uses a lot of memory, and as a result your game will run significantly slower while profiling. If you are using complex sc
15、ript code, Deep Profiling might not be possible at all. Deep profiling should work fast enough for small games with simple scripting. If you find that Deep Profiling for your entire game causes the frame rate to drop so much that the game barely runs, you should consider not using this approach, and
16、 instead use the approach described below. You may find deep profiling more helpful as you are designing your game and deciding how to best implement key features. Note that for large games deep profiling may cause Unity to run out of memory and so for this reason deep profiling may not be possible.
17、注意深度分析(Deep Profiling)会造成非常大的开销,并使用大量的内存,结果你的游戏在分析同时运行明显变慢。如果您使用的是复杂的脚本代码,深度分析可能不会完全有效。深度分析为使用简单的脚本的小游戏工作足够快。如果您发现您的整个游戏在深度分析时运行,导致帧速率下降很多,以至于游戏几乎不能运行,你应该考虑不采用这种方法,而是使用下面描述的方法。您可能会发现深度分析更有利于设计你的游戏,并确定如何最好地实现关键特性。注意深度分析,对于大型游戏可能会导致Unity耗尽内存,基于这个原因,深度分析未必有效。Manually profiling blocks of your script cod
18、e will have a smaller overhead than using Deep Profiling. Use Profiler.BeginSample and Profiler.EndSample scripting functions to enable and disable profiling around sections of code.手动分析脚本代码块比使用深度分析产生更小的开销。使用Profiler.BeginSample和Profiler.EndSample函数,启用和禁用分析代码段(从Profiler.BeginSample 到Profiler.EndSamp
19、le间的代码)。View SyncTime 查看SyncTimeWhen running at a fixed framerate or running in sync with the vertical blank, Unity records the waiting time in Wait For Target FPS. By default this amount of time is not shown in the profiler. To view how much time is spent waiting, you can toggle View SyncTime. This
20、 is also a measure of how much headroom you have before losing frames.当运行在一个固定的帧率或带垂直空白同步运行,Unity在Wait For Target FPS记录等待时间,默认情况下,该段时间没有显示在分析器。要查看等待花费多少时间,您可以切换View SyncTime。这也是衡量多少余量你之前丢失帧。Profiler Timeline 分析器时间轴The upper part of the Profiler window displays performance data over time. When you ru
21、n a game, data is recorded each frame, and the history of the last several hundred frames is displayed. Clicking on a particular frame will display its details in the lower part of the window. Different details are displayed depending on which timeline area is currently selected.分析器窗口的上部显示随着时间的推移的性能
22、数据。当您运行游戏,每一帧数据被记录,最后则会显示几百帧的历史。点击一个特定的帧上,该帧的细节将显示在窗口的下部。具体取决于当前选定的时间轴区域显示不同的细节。The vertical scale of the timeline is managed automatically and will attempt to fill the vertical space of the window. Note that to get more detail in say the CPU Usage area you can remove the Memory and Rendering areas.
23、 Also, the splitter between the timeline and the statistics area can be selected and dragged downward to increase the screen area used for the timeline chart.时间轴的垂直刻度是自动管理,并尝试填补窗口的垂直空间。请注意,要获得更多关于CPU的使用率(CPU Usage)的细节,您可以删除内存(Memory )和渲染(Rendering )区域。此外,时间轴和统计区域之间的分离器能被选择和向下拖动,为时间轴图表增加屏幕面积。The time
24、line consists of several areas: CPU Usage, Rendering and Memory. These areas can be removed by clicking the close button in the panel, and re-added again using the Add Area drop down in the Profile Controls bar.时间轴包括几个方面:CPU使用率,渲染和内存。这些区域可以在面板上按一下关闭按钮删除和 在分析控件(Profile Controls)工具栏中使用Add Area 下拉菜单再次重
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Unity3D 性能 消耗 分析器
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。