Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ProfilerModuleMetadataAttribute

Provides metadata for a ProfilerModule, including its display name, tooltip, and icon.
Read time 4 minutesLast updated 6 days ago

Definition

[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.
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) {}}

Constructors

Constructor

Description

ProfilerModuleMetadataAttribute(System.String)Initializes and returns an instance of ProfilerModuleMetadataAttribute.

Properties

Property

Description

DisplayNameThe attributed Profiler module’s display name.
IconPathThe path to the attributed Profiler module’s icon.
TooltipThe tooltip text displayed when hovering over the module in the Profiler window.

Inheritance

Inherited Members