Files
test/Assets/Editor/ComponentDebugMenu.cs
2025-12-23 14:19:04 +07:00

25 lines
735 B
C#

using UnityEditor;
using UnityEngine;
namespace BrewMonster
{
public static class ComponentDebugMenu
{
[MenuItem("CONTEXT/MonoBehaviour/Enable Debug")]
static void EnableDebug(MenuCommand command)
{
var comp = command.context as MonoBehaviour;
DebugRegistry.Enable(comp);
Debug.Log($"Debug enabled: {comp.name} ({comp.GetType().Name})");
}
[MenuItem("CONTEXT/MonoBehaviour/Disable Debug")]
static void DisableDebug(MenuCommand command)
{
var comp = command.context as MonoBehaviour;
DebugRegistry.Disable(comp);
Debug.Log($"Debug disabled: {comp.name} ({comp.GetType().Name})");
}
}
}