enabled
Enables recording.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Property
- Namespace: UnityEngine.Profiling
- Assembly: UnityEngine.CoreModule
public bool enabled { get; set; }
Remarks
When enabled Recorder collects data regardless of Profiler being enabled or not.
Note:
Set to false to make measurements available immediately for synchronous testing scenarious.
Examples
using UnityEngine;using UnityEngine.Profiling;public class Example{ public static void TimeSynchronousMethodWithMarkers() { var recorder = Recorder.Get("MyMarker"); recorder.enabled = true; // Starts measurements // Call method which uses MyMarker // MyMethod(); recorder.enabled = false; // Stops measurements and makes data available immediately Debug.Log("MyMarker total time, ns: " + recorder.elapsedNanoseconds); }}