@@ -11,8 +11,10 @@ public class DebugLogManagerEditor : Editor
11
11
private SerializedProperty enableHorizontalResizing ;
12
12
private SerializedProperty resizeFromRight ;
13
13
private SerializedProperty minimumWidth ;
14
- private SerializedProperty enablePopup ;
15
- private SerializedProperty startInPopupMode ;
14
+ private SerializedProperty logWindowOpacity ;
15
+ private SerializedProperty popupOpacity ;
16
+ private SerializedProperty popupVisibility ;
17
+ private SerializedProperty popupVisibilityLogFilter ;
16
18
private SerializedProperty startMinimized ;
17
19
private SerializedProperty toggleWithKey ;
18
20
private SerializedProperty toggleKey ;
@@ -37,6 +39,9 @@ public class DebugLogManagerEditor : Editor
37
39
private SerializedProperty popupAvoidsScreenCutout ;
38
40
private SerializedProperty autoFocusOnCommandInputField ;
39
41
42
+ #if UNITY_2017_3_OR_NEWER
43
+ private readonly GUIContent popupVisibilityLogFilterLabel = new GUIContent ( "Log Filter" , "Determines which log types will show the popup on screen" ) ;
44
+ #endif
40
45
private readonly GUIContent receivedLogTypesLabel = new GUIContent ( "Received Log Types" , "Only these logs will be received by the console window, other logs will simply be skipped" ) ;
41
46
private readonly GUIContent receiveInfoLogsLabel = new GUIContent ( "Info" ) ;
42
47
private readonly GUIContent receiveWarningLogsLabel = new GUIContent ( "Warning" ) ;
@@ -50,8 +55,10 @@ private void OnEnable()
50
55
enableHorizontalResizing = serializedObject . FindProperty ( "enableHorizontalResizing" ) ;
51
56
resizeFromRight = serializedObject . FindProperty ( "resizeFromRight" ) ;
52
57
minimumWidth = serializedObject . FindProperty ( "minimumWidth" ) ;
53
- enablePopup = serializedObject . FindProperty ( "enablePopup" ) ;
54
- startInPopupMode = serializedObject . FindProperty ( "startInPopupMode" ) ;
58
+ logWindowOpacity = serializedObject . FindProperty ( "logWindowOpacity" ) ;
59
+ popupOpacity = serializedObject . FindProperty ( "popupOpacity" ) ;
60
+ popupVisibility = serializedObject . FindProperty ( "popupVisibility" ) ;
61
+ popupVisibilityLogFilter = serializedObject . FindProperty ( "popupVisibilityLogFilter" ) ;
55
62
startMinimized = serializedObject . FindProperty ( "startMinimized" ) ;
56
63
toggleWithKey = serializedObject . FindProperty ( "toggleWithKey" ) ;
57
64
#if ENABLE_INPUT_SYSTEM && ! ENABLE_LEGACY_INPUT_MANAGER
@@ -103,11 +110,26 @@ public override void OnInspectorGUI()
103
110
104
111
EditorGUILayout . Space ( ) ;
105
112
106
- EditorGUILayout . PropertyField ( enablePopup ) ;
107
- if ( enablePopup . boolValue )
108
- DrawSubProperty ( startInPopupMode ) ;
109
- else
110
- DrawSubProperty ( startMinimized ) ;
113
+ EditorGUILayout . PropertyField ( startMinimized ) ;
114
+ EditorGUILayout . PropertyField ( logWindowOpacity ) ;
115
+ EditorGUILayout . PropertyField ( popupOpacity ) ;
116
+
117
+ EditorGUILayout . PropertyField ( popupVisibility ) ;
118
+ if ( popupVisibility . intValue == ( int ) PopupVisibility . WhenLogReceived )
119
+ {
120
+ EditorGUI . indentLevel ++ ;
121
+ #if UNITY_2017_3_OR_NEWER
122
+ popupVisibilityLogFilter . intValue = ( int ) ( DebugLogFilter ) EditorGUILayout . EnumFlagsField ( popupVisibilityLogFilterLabel , ( DebugLogFilter ) popupVisibilityLogFilter . intValue ) ;
123
+ #else
124
+ EditorGUI . BeginChangeCheck ( ) ;
125
+ bool infoLog = EditorGUILayout . Toggle ( "Info" , ( ( DebugLogFilter ) popupVisibilityLogFilter . intValue & DebugLogFilter . Info ) == DebugLogFilter . Info ) ;
126
+ bool warningLog = EditorGUILayout . Toggle ( "Warning" , ( ( DebugLogFilter ) popupVisibilityLogFilter . intValue & DebugLogFilter . Warning ) == DebugLogFilter . Warning ) ;
127
+ bool errorLog = EditorGUILayout . Toggle ( "Error" , ( ( DebugLogFilter ) popupVisibilityLogFilter . intValue & DebugLogFilter . Error ) == DebugLogFilter . Error ) ;
128
+ if ( EditorGUI . EndChangeCheck ( ) )
129
+ popupVisibilityLogFilter . intValue = ( infoLog ? ( int ) DebugLogFilter . Info : 0 ) | ( warningLog ? ( int ) DebugLogFilter . Warning : 0 ) | ( errorLog ? ( int ) DebugLogFilter . Error : 0 ) ;
130
+ #endif
131
+ EditorGUI . indentLevel -- ;
132
+ }
111
133
112
134
EditorGUILayout . PropertyField ( toggleWithKey ) ;
113
135
if ( toggleWithKey . boolValue )
0 commit comments