docs.unity.cn

Unity Profiling Core API 1.0.2

    Show / Hide Table of Contents

    Struct ProfilerCounterValue<T>

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

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

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

    Constructors

    ProfilerCounterValue(String)

    Constructs a ProfilerCounter that belongs to the generic ProfilerCategory.Scripts category. It is reported at the end of CPU frame to the Unity Profiler.

    Declaration
    public ProfilerCounterValue(string name)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerCounterValue(String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that belongs to the generic ProfilerCategory.Scripts category. It is reported at the end of CPU frame to the Unity Profiler.

    Declaration
    public ProfilerCounterValue(string name, ProfilerMarkerDataUnit dataUnit)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterValue(String, ProfilerMarkerDataUnit, ProfilerCounterOptions)

    Constructs a ProfilerCounter that belongs to generic ProfilerCategory.Scripts category.

    Declaration
    public ProfilerCounterValue(string name, ProfilerMarkerDataUnit dataUnit, ProfilerCounterOptions counterOptions)
    Parameters
    Type Name Description
    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterOptions counterOptions

    ProfilerCounter options.

    ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit)

    Constructs a ProfilerCounter that is reported at the end of CPU frame to the Unity Profiler.

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

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit, ProfilerCounterOptions)

    Constructs a ProfilerCounter.

    Declaration
    public ProfilerCounterValue(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit, ProfilerCounterOptions counterOptions)
    Parameters
    Type Name Description
    ProfilerCategory category

    Profiler category.

    String name

    Name of ProfilerCounter.

    ProfilerMarkerDataUnit dataUnit

    Value unit type.

    ProfilerCounterOptions counterOptions

    ProfilerCounter options.

    Properties

    Value

    Gets or sets value of the ProfilerCounter.

    Declaration
    public readonly T Value { get; set; }
    Property Value
    Type Description
    T
    Remarks

    Returns 0 and is not implemented in Release Players.

    Methods

    Sample()

    Sends the value to Unity Profiler immediately.

    Declaration
    public readonly void Sample()
    In This Article
    • Constructors
      • ProfilerCounterValue(String)
      • ProfilerCounterValue(String, ProfilerMarkerDataUnit)
      • ProfilerCounterValue(String, ProfilerMarkerDataUnit, ProfilerCounterOptions)
      • ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit)
      • ProfilerCounterValue(ProfilerCategory, String, ProfilerMarkerDataUnit, ProfilerCounterOptions)
    • Properties
      • Value
    • Methods
      • Sample()
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Monday, March 14, 2022
    Terms of use