Version: 2017.1

Profiler

class in UnityEngine.Profiling

切换到手册

描述

通过脚本控制 Profiler

You can add custom Profiler sections in your scripts with Profiler.BeginSample and Profiler.EndSample.

In standalone games, Profiler can dump all profiling information using Profiler.logFile and Profiler.enabled.

静态变量

enableBinaryLogSets profiler output file in built players.
enabled启用性能分析器。
logFileSets profiler output file in built players.
usedHeapSizeLong返回 Unity 已分配的字节数。这不包括外部库或驱动程序分配的字节。

静态函数

AddFramesFromFileDisplays the recorded profiledata in the profiler.
BeginSample开始使用自定义标签分析一段代码。
EndSample使用自定义标签结束对一段代码的分析。
GetMonoHeapSizeLong返回托管内存的预留空间大小。
GetMonoUsedSizeLong活动对象和非收集对象的已分配托管内存。
GetRuntimeMemorySizeLong收集 Unity 对象使用的本机内存。
GetTempAllocatorSize返回临时分配器的大小。
GetTotalAllocatedMemoryLongUnity 中的内部分配器分配的内存总量。Unity 在系统中预留了大型内存池。此函数将返回这些池中使用的内存量。
GetTotalReservedMemoryLongUnity 预留的总内存。
GetTotalUnusedReservedMemoryLong当 Unity 需要分配内存时,Unity 会在池中分配内存以供使用。此函数返回这些池中未使用的内存量。
SetTempAllocatorRequestedSize设置临时分配器的大小。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961