@@ -11,6 +11,7 @@ public abstract class BaseGameEventListenerEditor : Editor
11
11
private SerializedProperty _debugColor ;
12
12
private SerializedProperty _response ;
13
13
private SerializedProperty _enableDebug ;
14
+ private SerializedProperty _showDebugFields ;
14
15
15
16
protected abstract void DrawRaiseButton ( ) ;
16
17
@@ -22,23 +23,51 @@ protected virtual void OnEnable()
22
23
_event = serializedObject . FindProperty ( "_event" ) ;
23
24
_debugColor = serializedObject . FindProperty ( "_debugColor" ) ;
24
25
_response = serializedObject . FindProperty ( "_response" ) ;
25
- _enableDebug = serializedObject . FindProperty ( "_enableDebug" ) ;
26
+ _enableDebug = serializedObject . FindProperty ( "_enableGizmoDebugging" ) ;
27
+ _showDebugFields = serializedObject . FindProperty ( "_showDebugFields" ) ;
26
28
}
27
29
public override void OnInspectorGUI ( )
28
30
{
29
- EditorGUILayout . PropertyField ( _enableDebug ) ;
30
-
31
31
EditorGUILayout . ObjectField ( _event , new GUIContent ( "Event" , "Event which will trigger the response" ) ) ;
32
- _debugColor . colorValue = EditorGUILayout . ColorField ( new GUIContent ( "Debug Color" , "Color used to draw debug gizmos in the scene" ) , _debugColor . colorValue ) ;
33
-
34
32
EditorGUILayout . PropertyField ( _response , new GUIContent ( "Response" ) ) ;
35
-
36
- DrawRaiseButton ( ) ;
37
-
38
- _stackTrace . Draw ( ) ;
39
33
34
+ _showDebugFields . boolValue = EditorGUILayout . Foldout ( _showDebugFields . boolValue , new GUIContent ( "Show Debug Fields" ) ) ;
35
+ if ( _showDebugFields . boolValue )
36
+ {
37
+ DrawDebugging ( ) ;
38
+ }
39
+
40
40
EditorGUILayout . PropertyField ( DeveloperDescription ) ;
41
41
42
42
serializedObject . ApplyModifiedProperties ( ) ;
43
43
}
44
+ private void DrawDebugging ( )
45
+ {
46
+ EditorGUILayout . LabelField ( "Callback Debugging" , EditorStyles . boldLabel ) ;
47
+ using ( new EditorGUI . IndentLevelScope ( ) )
48
+ {
49
+ DrawRaiseButton ( ) ;
50
+
51
+ _stackTrace . Draw ( ) ;
52
+ }
53
+
54
+
55
+ EditorGUILayout . Space ( ) ;
56
+ EditorGUILayout . Space ( ) ;
57
+
58
+
59
+ EditorGUILayout . LabelField ( "Gizmo Debugging" , EditorStyles . boldLabel ) ;
60
+ using ( new EditorGUI . IndentLevelScope ( ) )
61
+ {
62
+ EditorGUILayout . PropertyField ( _enableDebug , new GUIContent ( "Enable Gizmo Debugging" ) ) ;
63
+
64
+ using ( new EditorGUI . DisabledGroupScope ( _enableDebug . boolValue ) )
65
+ {
66
+ EditorGUILayout . PropertyField ( _debugColor , new GUIContent ( "Debug Color" , "Color used to draw debug gizmos in the scene" ) ) ;
67
+ }
68
+ }
69
+
70
+
71
+ EditorGUILayout . Space ( ) ;
72
+ }
44
73
}
0 commit comments