Version: 2022.1
言語: 日本語
public void Start ();

説明

Start data collection.

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.

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 Stop to detach recorder from counter or marker. And ::Dispose to free unmanaged resources.