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.

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.

请注意,分析时必须检测你的代码。这检测会对你的游戏性能有小小影响。通常情况下,这种开销是足够小,不会影响游戏的帧率。当使用分析时,它是典型的考虑时间花费在某些领域的比例(或百分比)。此外,为了提高性能,重点在游戏消耗的时间最多的那些部分。代码更改前后比较分析结果,并确定您测量的改进。有时,您所做的更改来提高性能,可能对帧速率有负面影响;应预计代码优化的意外的后果。

  • Profiler window 分析器窗口

    • CPU Usage Area CPU使用率区域
    • Rendering Area 渲染区域
    • Memory Area 内存区域
    • Audio Area 音频区域
    • ProfilerPhysics 物理学区域
    • GPU Area GPU区域

See Also 参见

  • Optimizing Graphics Performance page. 
    优化图形性能页面
iOS

Remote profiling can be enabled on iOS devices by following these steps:

iOS设备上启用远程分析可以通过以下步骤:

  1. Connect your iOS device to your WiFi network (local/adhoc WiFi network is used by profiler to send profiling data from device to the Unity Editor). 
    您的iOS设备连接到WiFi网络(分析器使用本地/adhoc WiFi网络发送分析数据,从设备到Unity的编辑器)。
  2. Check "Autoconnect Profiler" checkbox in Unity's build settings dialog. 
    在Unity的构建设置(build settings)对话框中的,勾上复选框"自动连接分析器(Autoconnect Profiler)"。
  3. Attach your device to your Mac via cable and hit "Build & Run" in Unity Editor. 
    通过数据线将您的设备连接到你的Mac,在Unity编辑器中点击"Build &Run"。
  4. When app launches on device open profiler window in Unity Editor (Window->Profiler) 
    当应用程序在设备上启动,在Unity的编辑器打开分析器窗口(Window->Profiler)

If you are using a firewall, you need to make sure that ports 54998 to 55511 are open in the firewall's outbound rules - these are the ports used by Unity for remote profiling.

如果使用了防火墙,你必须确保端口54998 到 55511在防火墙的出站规则被打开。这些端口都是Unity远程分析要使用的端口。

Note: Sometimes Unity Editor might not autoconnect to the device. In such cases profiler connection might be initiated from Profiler Window Active Profiler drop down menu by select appropriate device.

注:有时,在Unity的编辑器可能不会自动连接到该设备。在这种情况下,在分析器窗口的Active Profiler下拉菜单选择相应的设备,分析器连接可以主动发起。

Android

Remote profiling can be enabled on Android devices through two different paths : WiFi or ADB.

远程分析可以在Android设备通过两种不同的途径启用:WiFi或ADB。

For WiFi profiling, follow these steps:

对于WiFi分析,用下列的这些步骤:

  1. Make sure to disable Mobile Data on your Android device. 
    确保在Andriod设备禁用手机数据。
  2. Connect your Android device to your WiFi network. 
    连接Android设备到你的Wifi网络。
  3. Check the "Autoconnect Profiler" checkbox in Unity's build settings dialog. 
    在Unity编译设置对话框,检查Autoconnect Profiler复选框是否勾选。
  4. Attach your device to your Mac/PC via cable and hit "Build & Run" in Unity Editor. 
    通过数据线连接你的设备到电脑,在Unity点击Build & Run。
  5. When the app launches on the device, open the profiler window in Unity Editor (Window->Profiler) 
    当应用程序在设备上启动,在Unity打开分析器窗口(Window->Profiler)。
  6. If the Unity Editor fails to autoconnect to the device, select the appropriate device from the Profiler Window Active Profiler drop down menu. 
    如果Unity无法自动连接到该设备,从分析器窗口Active Profiler下拉菜单,选择相应的设备。

Note: The Android device and host computer (running the Unity Editor) must both be on the same subnet for the device detection to work.

注意:Android设备和主机计算机(正运行Unity)必须两者在同一子网,才能正常运行设备检测工作。

For ADB profiling, follow these steps:

对于ADB分析,用下列的这些步骤:

  • Attach your device to your Mac/PC via cable and make sure ADB recognizes the device (i.e. it shows in adb devices list). 
    通过数据线连接设备到电脑,并确保ADB设备设备(也就是说它显示在ADB设备列表)。
  • Open a Terminal window / CMD prompt and enter 
    打开一个终端窗口/ CMD提示符并输入
adb forward tcp:54999 localabstract:Unity-<insert bundle identifier here> 
  • Check the "Development Build" checkbox in Unity's build settings dialog, and hit "Build & Run". 
    在Unity编译设置对话框,检查Development Build复选框是否勾选,并点击Build & Run。
  • When the app launches on the device, open the profiler window in Unity Editor (Window->Profiler) 
    当应用程序在设备上启动,在Unity打开分析器窗口(Window->Profiler)。
  • Select the AndroidProfiler(ADB@127.0.0.1:54999) from the Profiler Window Active Profiler drop down menu. 
    从分析器窗口Active Profiler下拉菜单选择AndroidProfiler(ADB@127.0.0.1:54999)

Note: The entry in the drop down menu is only visible when the selected target is Android.

注意:进入下拉菜单,当选择目标是Android唯一可见时选择。

If you are using a firewall, you need to make sure that ports 54998 to 55511 are open in the firewall's outbound rules - these are the ports used by Unity for remote profiling.

如果使用了防火墙,你必须确保端口54998 到 55511在防火墙的出站规则被打开。这些端口都是Unity远程分析要使用的端口。

Unity 分析器(仅专业版) Profiler (Pro only)相关推荐

  1. 卡巴斯基专业版KAV pro 5.0.372

    卡巴斯基专业版KAV pro 5.0.372 + 2006年6月27日授权 下载地址:http://bbs.macd.cn/viewthread.php?tid=746488    (要先注册论坛帐号 ...

  2. [Unity实战]仅需25行代码 安卓/ios打包跳过Unity启动Logo动画...[新手开箱可用][全平台支持]

    [Unity实战]仅需25行代码 安卓/ios打包跳过Unity启动Logo动画 参考文章 接上一篇文章-unity隐私协议包通过审查 1.直接上代码: 2.打包后使用效果展示: 3.源码地址: 参考 ...

  3. Unity 3D 遮挡剔除(仅专业版) Occlusion Culling (Pro only)

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! Occl ...

  4. 【Unity】优化工具Profiler

    Profiler 基本设置和布局 基本设置 基本布局 性能分析器(Profiler)是Unity内部集成的一款性能优化工具,可以检查脚本代码,查看运行过程中资源使用情况,还可以比较不同平台上的性能.但 ...

  5. iPhone 14不会全部采用挖孔屏 仅两款Pro版采用

    12月9日消息,据国外媒体报道,在iPhone 13系列正式发布之前,就曾有爆料人士透露,由于有太多的用户抱怨,iPhone 14在设计上会有一些改变,将采用挖孔屏,不会继续采用刘海屏. 但外媒在最新 ...

  6. [Unity实战]仅用2步-虚拟相机Cinemachine简易使用

    仅用2步-Unity虚拟相机Cinemachine简易使用 1.简介 2.使用(2步) 2.1 场景->创建一个VirtualCamera 2.2 把跟随对象创建选上 3.效果 4.我的项目(带 ...

  7. 处理Unity中使用HTC VIVE PRo的SRWork插件若干问题

    一.介绍 HTC VIVE Pro版本的头盔显示器可以使用一个叫SRWork的工具轻松制作混合现实功能的案例,如图1所示:功能很强大,目前据我写 图1 这篇文真为止已经更新到了SRWork0.9.7. ...

  8. iPhone 14仅两款Pro版搭载A16芯片 另外两款继续使用A15

    3月14日消息,据国外媒体报道,在苹果的iPhone 12和iPhone 13系列手机中,基本款和高端版在摄像头.屏幕等多个方面存在明显区别,进而导致在价格方面也有较大的差距. 而在苹果产品预测方面有 ...

  9. 交互式反汇编器专业版IDA Pro的一点介绍

    1.IDA的安装和版本 什么是IDA? IDA Pro是一款交互式的,可编程的,可扩展的,多处理器的,交叉Windows或Linux WinCE MacOS平台主机来分析程序, 被公认为最好的花钱可以 ...

最新文章

  1. 面向中小企业的视频云服务 视频托管
  2. zerodivisionerror什么意思python-Python中%的结果是什么?
  3. 修改数据结构记录,将同级数据改成父子集数据
  4. centos配置oracle自启,centos 下配置oracle11gR2开机自启
  5. JDBC连接池C3P0,druid
  6. phpexcel中文教程-设置表格字体颜色背景样式、数据格式、对齐方式、添加图片、批注、文字块、合并拆分单元格、单元格密码保护
  7. 字符串匹配之KMP(KnuthMorrisPratt)算法(图解)
  8. [极客大挑战 2019]EasySQL
  9. 获取今日、本周、本月至今日的所有日期
  10. idea2020.3升级lombok不能使用
  11. 操作元素之表单属性设置
  12. atan和atan2反正切计算
  13. pdf转word,这个库好用
  14. 美团 2021 届秋季校园招聘—小团的 AB 队(排序)
  15. Java开发必须掌握!java面试没问技术问题
  16. 机器学习算法各个击破
  17. C语言中的光标定位函数
  18. Python工程师面试汇总
  19. 点餐系统-----数据库设计
  20. 【科研绘图】PS绘制封面中神奇的放大效果

热门文章

  1. java props_spring:使用prop标签为Java持久属性集注入值
  2. python四大高阶函数_四大高阶函数
  3. 微型计算机中的数据总线用来,微型计算机技术及应用(戴梅萼4)练习题答案.doc...
  4. linux vim 添加注释_vim基础教程
  5. php cache-control,网页缓存控制 Cache-control 常见的取值有private、no-cache、max-age、must-revalidate 介绍...
  6. matlab fopen函数的用法,matlab中关于fread函数的用法
  7. redis的zset的底层实现_Redis中hash、set、zset有多牛?从底层告诉你数据结构原理...
  8. Struts 体系结构与工作原理 图
  9. 《天天数学》连载41:二月十日
  10. Django讲课笔记10:使用QuerySet删除和查询数据表