@@ -139,22 +139,17 @@ public static void DrawSplitter()
139
139
if ( Event . current . type != EventType . Repaint )
140
140
return ;
141
141
142
- EditorGUI . DrawRect ( rect , ! EditorGUIUtility . isProSkin
143
- ? new Color ( 0.6f , 0.6f , 0.6f , 1.333f )
144
- : new Color ( 0.12f , 0.12f , 0.12f , 1.333f ) ) ;
142
+ EditorGUI . DrawRect ( rect , Styling . splitter ) ;
145
143
}
146
144
147
145
public static void DrawOverrideCheckbox ( Rect rect , SerializedProperty property )
148
146
{
149
- var oldColor = GUI . color ;
150
- GUI . color = new Color ( 0.6f , 0.6f , 0.6f , 0.75f ) ;
151
147
property . boolValue = GUI . Toggle ( rect , property . boolValue , GetContent ( "|Override this setting for this volume." ) , Styling . smallTickbox ) ;
152
- GUI . color = oldColor ;
153
148
}
154
149
155
150
public static void DrawHeaderLabel ( string title )
156
151
{
157
- EditorGUILayout . LabelField ( title , Styling . labelHeader ) ;
152
+ EditorGUILayout . LabelField ( title , Styling . headerLabel ) ;
158
153
}
159
154
160
155
public static bool DrawHeader ( string title , bool state )
@@ -175,13 +170,12 @@ public static bool DrawHeader(string title, bool state)
175
170
backgroundRect . width += 4f ;
176
171
177
172
// Background
178
- float backgroundTint = EditorGUIUtility . isProSkin ? 0.1f : 1f ;
179
- EditorGUI . DrawRect ( backgroundRect , new Color ( backgroundTint , backgroundTint , backgroundTint , 0.2f ) ) ;
173
+ EditorGUI . DrawRect ( backgroundRect , Styling . headerBackground ) ;
180
174
181
175
// Title
182
176
EditorGUI . LabelField ( labelRect , GetContent ( title ) , EditorStyles . boldLabel ) ;
183
177
184
- // Active checkbox
178
+ // Foldout
185
179
state = GUI . Toggle ( foldoutRect , state , GUIContent . none , EditorStyles . foldout ) ;
186
180
187
181
var e = Event . current ;
@@ -203,32 +197,39 @@ public static bool DrawHeader(string title, SerializedProperty group, Serialized
203
197
var backgroundRect = GUILayoutUtility . GetRect ( 1f , 17f ) ;
204
198
205
199
var labelRect = backgroundRect ;
206
- labelRect . xMin += 16f ;
200
+ labelRect . xMin += 32f ;
207
201
labelRect . xMax -= 20f ;
208
202
203
+ var foldoutRect = backgroundRect ;
204
+ foldoutRect . y += 1f ;
205
+ foldoutRect . width = 13f ;
206
+ foldoutRect . height = 13f ;
207
+
209
208
var toggleRect = backgroundRect ;
209
+ toggleRect . x += 16f ;
210
210
toggleRect . y += 2f ;
211
211
toggleRect . width = 13f ;
212
212
toggleRect . height = 13f ;
213
213
214
- var menuIcon = EditorGUIUtility . isProSkin
215
- ? Styling . paneOptionsIconDark
216
- : Styling . paneOptionsIconLight ;
217
-
214
+ var menuIcon = Styling . paneOptionsIcon ;
218
215
var menuRect = new Rect ( labelRect . xMax + 4f , labelRect . y + 4f , menuIcon . width , menuIcon . height ) ;
219
216
220
217
// Background rect should be full-width
221
218
backgroundRect . xMin = 0f ;
222
219
backgroundRect . width += 4f ;
223
220
224
221
// Background
225
- float backgroundTint = EditorGUIUtility . isProSkin ? 0.1f : 1f ;
226
- EditorGUI . DrawRect ( backgroundRect , new Color ( backgroundTint , backgroundTint , backgroundTint , 0.2f ) ) ;
222
+ EditorGUI . DrawRect ( backgroundRect , Styling . headerBackground ) ;
227
223
228
224
// Title
229
225
using ( new EditorGUI . DisabledScope ( ! activeField . boolValue ) )
230
226
EditorGUI . LabelField ( labelRect , GetContent ( title ) , EditorStyles . boldLabel ) ;
231
227
228
+ // foldout
229
+ group . serializedObject . Update ( ) ;
230
+ group . isExpanded = GUI . Toggle ( foldoutRect , group . isExpanded , GUIContent . none , EditorStyles . foldout ) ;
231
+ group . serializedObject . ApplyModifiedProperties ( ) ;
232
+
232
233
// Active checkbox
233
234
activeField . serializedObject . Update ( ) ;
234
235
activeField . boolValue = GUI . Toggle ( toggleRect , activeField . boolValue , GUIContent . none , Styling . smallTickbox ) ;
0 commit comments