Version: 2023.1

ProfilerCounterDescriptorConstructor

切换到手册
public ProfilerCounterDescriptor (string name, Unity.Profiling.ProfilerCategory category);

参数

name The name of the Profiler counter to describe. A string.
category The category of the Profiler counter to describe. A ProfilerCategory.

描述

Initializes and returns an instance of ProfilerCounterDescriptor.

using System;
using Unity.Profiling;
using Unity.Profiling.Editor;

[Serializable] [ProfilerModuleMetadata("Garbage Collection")] public class GarbageCollectionProfilerModule : ProfilerModule { static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("GC Reserved Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Used Memory", ProfilerCategory.Memory), new ProfilerCounterDescriptor("GC Allocated In Frame", ProfilerCategory.Memory), };

public GarbageCollectionProfilerModule() : base(k_ChartCounters) {} }

See Also: ProfilerModule.


public ProfilerCounterDescriptor (string name, string categoryName);

参数

name The name of the Profiler counter to describe, as a string.
categoryName The category name of the Profiler counter to describe, as a string.

描述

Initializes and returns an instance of ProfilerCounterDescriptor.

using System;
using Unity.Profiling;
using Unity.Profiling.Editor;

[Serializable] [ProfilerModuleMetadata("Garbage Collection")] public class GarbageCollectionProfilerModule : ProfilerModule { static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("GC Reserved Memory", ProfilerCategory.Memory.Name), new ProfilerCounterDescriptor("GC Used Memory", ProfilerCategory.Memory.Name), new ProfilerCounterDescriptor("GC Allocated In Frame", ProfilerCategory.Memory.Name), };

public GarbageCollectionProfilerModule() : base(k_ChartCounters) {} }

See Also: ProfilerModule.