24 lines
605 B
C#
24 lines
605 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
[CustomEditor(typeof(MonoBehaviour), true)]
|
|
public class DebuggableInspector : Editor
|
|
{
|
|
public override void OnInspectorGUI()
|
|
{
|
|
var targetMb = target as MonoBehaviour;
|
|
|
|
if (targetMb != null && DebugRegistry.IsEnabled(targetMb))
|
|
{
|
|
GUI.backgroundColor = Color.yellow;
|
|
EditorGUILayout.HelpBox("DEBUG ENABLED", MessageType.Info);
|
|
GUI.backgroundColor = Color.white;
|
|
}
|
|
|
|
DrawDefaultInspector();
|
|
}
|
|
}
|
|
}
|