Version: 2022.2
言語: 日本語
public bool enabled ;

説明

Enables recording.

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.

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); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961