Skip to content

Game.Debug.DebugTabAttribute

Assembly:
Namespace: Game.Debug

Type: class

Base: UnityEngine.Scripting.PreserveAttribute

Summary: Attribute used to mark a method as a debug tab for the in-game debug UI. Attach this attribute to static (or instance) methods you want discovered as debug tabs; the attribute carries a display name and a priority value that the debug UI can use to order tabs. This attribute inherits from PreserveAttribute to prevent stripping by managed code stripping tools.


Fields

  • public readonly string name The display name for the debug tab. This name is shown in the debug UI as the tab label.

  • public readonly int priority A numeric priority value used to influence tab ordering. Tabs are typically sorted by this value by the debug UI; use it to control the relative order of multiple tabs.

Properties

  • none This attribute exposes only readonly fields; there are no properties defined.

Constructors

  • public DebugTabAttribute(string name, int priority = 0) Creates a new DebugTabAttribute. Parameters:
  • name: The display name for the debug tab.
  • priority (optional): An integer used to influence ordering among tabs. Defaults to 0.

Methods

  • none This attribute type does not define methods beyond those inherited from System.Attribute / PreserveAttribute.

Usage Example

using Game.Debug;

public static class MyDebugTabs
{
    // A simple debug tab with default priority
    [DebugTab("Rendering")]
    public static void RenderingTab()
    {
        // Draw debug UI for rendering here
    }

    // A debug tab with explicit priority to control ordering
    [DebugTab("Traffic", priority: 10)]
    public static void TrafficTab()
    {
        // Draw debug UI for traffic here
    }
}