【Debug与Profiler】Unity Profiling Core

本文详细介绍了如何使用Unity的ProfilerMarker API进行代码性能标记,以及如何通过ProfilerCounter API追踪应用程序的关键指标。ProfilerMarker用于标记资源密集型代码块,而ProfilerCounter支持推拉操作,用于记录帧率、内存等数据。文章还讲解了如何在Profiler窗口中查看这些数据,并提供在编辑器和播放器中获取计数器值的方法。
摘要由CSDN通过智能技术生成

/ProfilerMarker API guide//

Use ProfilerMarker to mark up resource-intensive script code blocks and make them visible in the Unity Profiler.

This can be useful because by default, the built-in Unity Profiler does not profile all method calls. Also, if you enable Deep Profiling, it causes a large overhead that significantly slows down your application execution and skews the results.

To use the ProfilerMarker API, start your code with ProfilerMarker.Begin() and end it with ProfilerMarker.End() like the following:

using UnityEngine;
using Unity.Profiling;

public class Profile
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值