U3DC.COM | 优三帝研究院

Menu

unity官方手册(高级)翻译(1)Profiler分析器

The 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.

Untiy分析器帮助你优化你的游戏。它为你报告花费多少时间在你的游戏各个领域里。例如,它可以报告花费的时间百分比用于渲染,动画,或在你的游戏逻辑。

The profiler was added at Unity version 2.6. It is a Unity Pro feature. 分析器是加在Unity版本2.6里。这是一个Unity专业版的功能。

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 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 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 that 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.

请注意,要分析器必须分析你的代码。这种仪器拥有对你的游戏的性能影响很小。一般来说,这个开销是足够小,不会影响游戏的帧率。当使用分析它通常只考虑比率(或百分比在某些区域所花的时间)。此外,为了提高性能对游戏的部分消耗最多的焦点。比较前后修改代码,并确定你的改进措施以及分析结果。有时会改变你对提高性能可能会对帧速率的产生负面效应;代码优化意想不到的后果应被预期。

打赏
— 于 共写了1497个字
— 文内使用到的标签:

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据