docs.unity.cn

Unity Profiling Core API 1.0.2

    Show / Hide Table of Contents

    Struct ProfilerCounter<T>

    Reports a value of an integer or floating point type to the Unity Profiler.

    Namespace: Unity.Profiling
    Syntax
    public readonly struct ProfilerCounter<T>
        where T : struct
    Type Parameters
    Name Description
    T

    int, uint, long, ulong, float or double type.

    Constructors

    ProfilerCounter(ProfilerCategory, String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that is reported to the Unity Profiler whenever you call Sample().

    Declaration
    public ProfilerCounter(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit)
    Parameters
    Type Name Description
    ProfilerCategory category

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    Methods

    Sample(T)

    Sends the value to Unity Profiler immediately.

    Declaration
    public readonly void Sample(T value)
    Parameters
    Type Name Description
    T value

    The value to send to the profiler.

    Remarks

    Does nothing in Release Players.

    In This Article
    • Constructors
      • ProfilerCounter(ProfilerCategory, String, ProfilerMarkerDataUnit)
    • Methods
      • Sample(T)
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Monday, March 14, 2022
    Terms of use