Version: 2023.1
언어: 한국어
public static Profiling.Sampler Get (string name);

파라미터

name Profiler Sampler name.

반환

Sampler Sampler object which represents specific profiler label.

설명

Returns Sampler object for the specific CPU Profiler label.

You can use this function to get a Sampler associated with a built-in or custom label. The name parameter is the same you can see in Hierarchy view of the Profiler Window. If label with the specified name parameter does not exist or not available in the Player, an invalid Sampler object will be returned. You can use Sampler.isValid to verify if Sampler is valid.

using UnityEngine;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour { Sampler sampler; void Start() { sampler = Sampler.Get("BehaviourUpdate"); } }

Get can be used to obtain any existing Sampler including custom Sampler. Return value is always Sampler type and can not be casted to CustomSampler.

Note: At the moment all built-in counters are available only in the Editor and Development Players. Get in non-Development Players returns invalid Sampler.

See Also: Sampler, Sampler.isValid, CPU Usage Profiler.

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