ドキュメント

Unity Engine

Unity Engine

Start()

Start data collection.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

public void Start()

Remarks

Newly constructed recorder is not collecting samples unless ProfilerRecorderOptions.StartImmediately option is specified. Use Start to attach ProfilerRecorder to the Profiler metric and start data collection.
Note: Starting recorder which has 0 ProfilerRecorder.Capacity throws InvalidOperationException.
using Unity.Profiling;using UnityEngine;public class ExampleScript : MonoBehaviour{ ProfilerRecorder mainThreadTimeRecorder; void OnEnable() { mainThreadTimeRecorder = new ProfilerRecorder(ProfilerCategory.Internal, "Main Thread", 15); mainThreadTimeRecorder.Start(); } void OnDisable() { mainThreadTimeRecorder.Dispose(); }}
When you don't need data to be collected use ProfilerRecorder.Stop to detach recorder from counter or marker. And ProfilerRecorder.Dispose to free unmanaged resources.