ProfilerModuleMetadataAttribute
Provides metadata for a ProfilerModule, including its display name, tooltip, and icon.
Read time 4 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.Profiling.Editor
- Assembly: UnityEditor.CoreModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]public class ProfilerModuleMetadataAttribute : Attribute
Remarks
Apply this attribute to a ProfilerModule derived class to configure how it appears in the Profiler window. The attribute is required for Unity to discover and display custom Profiler modules.
You can customize the module's appearance by setting the ProfilerModuleMetadataAttribute.DisplayName, ProfilerModuleMetadataAttribute.Tooltip, and ProfilerModuleMetadataAttribute.IconPath properties.
using System;using Unity.Profiling;using Unity.Profiling.Editor;[ProfilerModuleMetadata( "Network Statistics", Tooltip = "Displays network packet statistics and bandwidth usage", IconPath = "Assets/Icons/NetworkProfilerIcon.png")]public class NetworkProfilerModule : ProfilerModule{ static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[] { new ProfilerCounterDescriptor("Packets Sent", "Network"), new ProfilerCounterDescriptor("Packets Received", "Network"), }; public NetworkProfilerModule() : base(k_ChartCounters) {}}
Additional Resources: ProfilerModule, ProfilerModuleViewController.
Constructors
Constructor | Description |
|---|---|
| ProfilerModuleMetadataAttribute(System.String) | Initializes and returns an instance of ProfilerModuleMetadataAttribute. |
Properties
Property | Description |
|---|---|
| DisplayName | The attributed Profiler module’s display name. |
| IconPath | The path to the attributed Profiler module’s icon. |
| Tooltip | The tooltip text displayed when hovering over the module in the Profiler window. |