Version: 2021.1

返回

AutoScope IDisposable 结构,自动调用 BeginEnd

描述

为作用域 using 块创建一个 helper 结构。

在构造函数中调用 Begin 以及在 Dispose 方法中调用 End

__注意:__.Auto 具有线程安全性,可以在作业化的代码中使用。

using Unity.Profiling;

public class MySystemClass { static ProfilerMarker s_SimulatePerfMarker = new ProfilerMarker("MySystem.Simulate");

public void UpdateLogic() { using (s_SimulatePerfMarker.Auto()) { // ... } } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961