samplerName | 采样器名称。 |
Recorder 指定采样器的 Recorder 对象。
使用此函数可获取特定性能分析器标签的录制器。
using UnityEngine;
using UnityEngine.Profiling;
public class ExampleClass : MonoBehaviour
{
Recorder behaviourUpdateRecorder;
void Start()
{
behaviourUpdateRecorder = Recorder.Get("BehaviourUpdate");
behaviourUpdateRecorder.enabled = true;
}
void Update()
{
if (behaviourUpdateRecorder.isValid)
Debug.Log("BehaviourUpdate time: " + behaviourUpdateRecorder.elapsedNanoseconds);
}
}
另请参阅:Sampler、Sampler.GetRecorder。