@@ -139,22 +139,17 @@ public static void DrawSplitter()
139139 if ( Event . current . type != EventType . Repaint )
140140 return ;
141141
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 ) ;
145143 }
146144
147145 public static void DrawOverrideCheckbox ( Rect rect , SerializedProperty property )
148146 {
149- var oldColor = GUI . color ;
150- GUI . color = new Color ( 0.6f , 0.6f , 0.6f , 0.75f ) ;
151147 property . boolValue = GUI . Toggle ( rect , property . boolValue , GetContent ( "|Override this setting for this volume." ) , Styling . smallTickbox ) ;
152- GUI . color = oldColor ;
153148 }
154149
155150 public static void DrawHeaderLabel ( string title )
156151 {
157- EditorGUILayout . LabelField ( title , Styling . labelHeader ) ;
152+ EditorGUILayout . LabelField ( title , Styling . headerLabel ) ;
158153 }
159154
160155 public static bool DrawHeader ( string title , bool state )
@@ -175,13 +170,12 @@ public static bool DrawHeader(string title, bool state)
175170 backgroundRect . width += 4f ;
176171
177172 // 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 ) ;
180174
181175 // Title
182176 EditorGUI . LabelField ( labelRect , GetContent ( title ) , EditorStyles . boldLabel ) ;
183177
184- // Active checkbox
178+ // Foldout
185179 state = GUI . Toggle ( foldoutRect , state , GUIContent . none , EditorStyles . foldout ) ;
186180
187181 var e = Event . current ;
@@ -203,32 +197,39 @@ public static bool DrawHeader(string title, SerializedProperty group, Serialized
203197 var backgroundRect = GUILayoutUtility . GetRect ( 1f , 17f ) ;
204198
205199 var labelRect = backgroundRect ;
206- labelRect . xMin += 16f ;
200+ labelRect . xMin += 32f ;
207201 labelRect . xMax -= 20f ;
208202
203+ var foldoutRect = backgroundRect ;
204+ foldoutRect . y += 1f ;
205+ foldoutRect . width = 13f ;
206+ foldoutRect . height = 13f ;
207+
209208 var toggleRect = backgroundRect ;
209+ toggleRect . x += 16f ;
210210 toggleRect . y += 2f ;
211211 toggleRect . width = 13f ;
212212 toggleRect . height = 13f ;
213213
214- var menuIcon = EditorGUIUtility . isProSkin
215- ? Styling . paneOptionsIconDark
216- : Styling . paneOptionsIconLight ;
217-
214+ var menuIcon = Styling . paneOptionsIcon ;
218215 var menuRect = new Rect ( labelRect . xMax + 4f , labelRect . y + 4f , menuIcon . width , menuIcon . height ) ;
219216
220217 // Background rect should be full-width
221218 backgroundRect . xMin = 0f ;
222219 backgroundRect . width += 4f ;
223220
224221 // 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 ) ;
227223
228224 // Title
229225 using ( new EditorGUI . DisabledScope ( ! activeField . boolValue ) )
230226 EditorGUI . LabelField ( labelRect , GetContent ( title ) , EditorStyles . boldLabel ) ;
231227
228+ // foldout
229+ group . serializedObject . Update ( ) ;
230+ group . isExpanded = GUI . Toggle ( foldoutRect , group . isExpanded , GUIContent . none , EditorStyles . foldout ) ;
231+ group . serializedObject . ApplyModifiedProperties ( ) ;
232+
232233 // Active checkbox
233234 activeField . serializedObject . Update ( ) ;
234235 activeField . boolValue = GUI . Toggle ( toggleRect , activeField . boolValue , GUIContent . none , Styling . smallTickbox ) ;
0 commit comments