An extensible debug window framework for the Unity Editor that auto-discovers debug tabs from any assembly in the project.
GameDebugHub provides a single editor window — Tools > Game Debug Hub — that collects and displays debug tabs contributed by any Editor assembly. Tabs are discovered at domain reload using Unity's TypeCache, so any submodule or shared code package can add tabs without registering them centrally. The core package contains no project-specific strings and is designed to drop into any Unity project unchanged.
- Attribute-based tab discovery — apply
[DebugHubTab]to a class and it appears in the hub automatically; no manual registration step required - Cross-assembly discovery — tabs can be defined in any Editor assembly that references
GameDebugHub - Framework grouping — tab source is inferred from the
Submodules/folder path, namespace, or assembly name; shown in the debug info overlay - Tab ordering — sort tabs with the
Orderparameter (lower values first); tabs with equal order sort by framework, module, then name - Conditional visibility —
ShouldShow()hides tabs that are irrelevant to the current context (for example, tabs that require play mode or a specific scene object) - Lifecycle hooks —
OnTabSelected(),OnTabDeselected(),RequiresUpdate(), andOnUpdate()let tabs respond to selection changes and request continuous repaints - Searchable entity lists —
DebugHubTabBase.DrawEntityList<T>()provides a reusable foldout list with search, Focus, Select, and Properties buttons - Scene view focusing —
FocusSceneViewOnEntity()andFocusSceneViewOnPosition()helper methods for spatial debugging - Error isolation — an exception in one tab is caught and displayed inline; other tabs continue working
- Debug info overlay — toggle "Debug Info" in the window header to see assembly, framework, module, and order metadata for the active tab
Unity Package Manager (recommended)
{
"dependencies": {
"com.frostebite.gamedebughub": "https://github.com/frostebite/GameDebugHub.git"
}
}Git submodule
git submodule add https://github.com/frostebite/GameDebugHub.git Assets/_Engine/Submodules/GameDebugHub- Unity 2021.3 or later
- No external dependencies
All types are in the GameDebugHub namespace. Add using GameDebugHub; to any file that references DebugHubTabAttribute, IDebugHubTab, or DebugHubTabBase.
Create a class in any Editor assembly, apply [DebugHubTab], and extend DebugHubTabBase:
using GameDebugHub;
using UnityEditor;
using UnityEngine;
[DebugHubTab("My Tab", Order = 10)]
public class MyDebugTab : DebugHubTabBase
{
public override string TabName => "My Tab";
public override void OnGUI()
{
EditorGUILayout.LabelField("Hello from My Tab", EditorStyles.boldLabel);
if (GUILayout.Button("Do Something"))
{
Debug.Log("My Tab button clicked");
}
}
}Your assembly definition must reference GameDebugHub so the attribute and base class are available. The tab appears in Tools > Game Debug Hub after the next recompile.
Alternatively, implement IDebugHubTab directly if you do not want the base class utilities:
using GameDebugHub;
using UnityEditor;
[DebugHubTab("Minimal Tab")]
public class MinimalTab : IDebugHubTab
{
public string TabName => "Minimal Tab";
public void OnGUI()
{
EditorGUILayout.LabelField("Minimal tab content");
}
}| Method | When called |
|---|---|
OnGUI() |
Every repaint while the tab is selected |
ShouldShow() |
Before each repaint; return false to hide the tab |
OnTabSelected() |
When the user switches to this tab |
OnTabDeselected() |
When the user switches away from this tab |
RequiresUpdate() |
Each editor update tick; return true to request a repaint |
OnUpdate() |
Each editor update tick, only if RequiresUpdate() returns true |
Use ShouldShow() to hide tabs that are not relevant in the current context:
public override bool ShouldShow()
{
// Only visible during play mode
return Application.isPlaying;
}public override bool ShouldShow()
{
// Only visible when a specific component exists in the scene
return Object.FindObjectOfType<MyGameManager>() != null;
}For tabs that display live data, return true from RequiresUpdate() and update state in OnUpdate():
using GameDebugHub;
using UnityEditor;
using UnityEngine;
[DebugHubTab("Live Stats", Order = 5)]
public class LiveStatsTab : DebugHubTabBase
{
private float _fps;
public override string TabName => "Live Stats";
public override bool RequiresUpdate() => true;
public override void OnUpdate()
{
if (Time.deltaTime > 0f)
_fps = 1f / Time.deltaTime;
}
public override void OnGUI()
{
EditorGUILayout.LabelField($"FPS: {_fps:F1}");
}
}Tab does not appear
- Confirm the class has
[DebugHubTab]. - Confirm the class implements
IDebugHubTabor extendsDebugHubTabBaseand is not abstract. - Confirm
ShouldShow()returnstruein the current context. - Confirm your assembly definition references
GameDebugHub. - Enable "Debug Info" in the window to see how many tabs were loaded.
- Click "Reload Tabs" to force re-discovery without a full recompile.
Tab throws an exception
The exception is caught and displayed inside the tab content area. Other tabs are unaffected. Enable "Debug Info" to see the full stack trace.
See LICENSE file.