@@ -49,7 +49,7 @@ private void OnDisable()
49
49
PlayerPrefs . SetString ( PrefsKey , JsonUtility . ToJson ( _sceneSwitcherData ) ) ;
50
50
}
51
51
52
- private bool _editing = false ;
52
+ private bool _editing ;
53
53
54
54
private void OnGUI ( )
55
55
{
@@ -163,9 +163,10 @@ private void SceneListGui()
163
163
164
164
GUILayout . EndVertical ( ) ;
165
165
166
- int lineHeight = 18 ;
166
+ const int lineHeight = 18 ;
167
167
if ( _editing )
168
168
{
169
+ //Draw Toggle Buttons
169
170
GUILayout . BeginHorizontal ( ) ;
170
171
_sceneSwitcherData . sortRecentToTop = GUILayout . Toggle ( _sceneSwitcherData . sortRecentToTop ,
171
172
new GUIContent ( "Auto Sort" , "Will sort most recently used scenes to the top" ) ,
@@ -176,19 +177,16 @@ private void SceneListGui()
176
177
new GUIContent ( "Close" , "Will close/unload other scenes when additive loading is active" ) ,
177
178
GUILayout . Height ( lineHeight ) ) ;
178
179
GUILayout . EndHorizontal ( ) ;
179
- }
180
-
181
- if ( _editing )
182
- {
180
+
181
+ //Draw Done Button
183
182
GUILayout . BeginHorizontal ( ) ;
184
183
185
184
GUILayout . FlexibleSpace ( ) ;
186
- GUI . backgroundColor = _editing ? Color . green : Color . red ;
187
- if ( GUILayout . Button ( _editing ? "Done" : "Edit ", GUILayout . MaxWidth ( 60 ) ) )
185
+ GUI . backgroundColor = Color . green ;
186
+ if ( GUILayout . Button ( "Done" , GUILayout . MaxWidth ( 60 ) ) )
188
187
{
189
188
_editing = ! _editing ;
190
189
}
191
-
192
190
GUI . backgroundColor = Color . white ;
193
191
194
192
GUILayout . EndHorizontal ( ) ;
0 commit comments