@@ -168,7 +168,7 @@ private static GUIContent GetEditorTitle(InputActionAsset asset, bool isDirty)
168168 return new GUIContent ( text ) ;
169169 }
170170
171- private void SetAsset ( InputActionAsset asset , string actionToSelect = null , string actionMapToSelect = null , bool shouldClearRootVisualElement = true )
171+ private void SetAsset ( InputActionAsset asset , string actionToSelect = null , string actionMapToSelect = null )
172172 {
173173 var existingWorkingCopy = m_AssetObjectForEditing ;
174174
@@ -189,7 +189,7 @@ private void SetAsset(InputActionAsset asset, string actionToSelect = null, stri
189189 m_State = m_State . SelectAction ( actionToSelect ) ;
190190 }
191191
192- BuildUI ( shouldClearRootVisualElement ) ;
192+ BuildUI ( ) ;
193193 }
194194 catch ( Exception e )
195195 {
@@ -262,7 +262,7 @@ private void CleanupStateContainer()
262262 }
263263 }
264264
265- private void BuildUI ( bool shouldClearRoot = true )
265+ private void BuildUI ( )
266266 {
267267 CleanupStateContainer ( ) ;
268268
@@ -271,32 +271,13 @@ private void BuildUI(bool shouldClearRoot = true)
271271
272272 m_StateContainer = new StateContainer ( m_State , m_AssetGUID ) ;
273273 m_StateContainer . StateChanged += OnStateChanged ;
274- IEnumerable < VisualElement > children = null ;
275- if ( ! shouldClearRoot )
276- {
277- children = new List < VisualElement > ( rootVisualElement . hierarchy . Children ( ) ) ;
278- }
279274
280275 rootVisualElement . Clear ( ) ;
281276
282277 if ( ! rootVisualElement . styleSheets . Contains ( InputActionsEditorWindowUtils . theme ) )
283278 rootVisualElement . styleSheets . Add ( InputActionsEditorWindowUtils . theme ) ;
284279 m_View = new InputActionsEditorView ( rootVisualElement , m_StateContainer , false , ( ) => Save ( isAutoSave : false ) ) ;
285280 m_StateContainer . Initialize ( rootVisualElement . Q ( "action-editor" ) ) ;
286-
287- if ( children != null )
288- {
289- foreach ( var child in children )
290- {
291- for ( int i = rootVisualElement . hierarchy . childCount - 1 ; i >= 0 ; i -- )
292- {
293- if ( rootVisualElement . hierarchy . ElementAt ( i ) . name != child . name )
294- {
295- rootVisualElement . hierarchy . Add ( child ) ;
296- }
297- }
298- }
299- }
300281 }
301282
302283 private void OnStateChanged ( InputActionsEditorState newState , UIRebuildMode editorRebuildMode )
@@ -388,7 +369,7 @@ private void OnLostFocus()
388369 // This code should be cleaned up once we migrate the InputControl stuff from ImGUI completely.
389370 // Since at that point it stops being a separate window that steals focus.
390371 // (See case ISXB-1221)
391- if ( ! InputControlPathEditor . IsShowingDropdown )
372+ if ( ! InputControlPathEditor . IsShowingDropdown && ! ControlSchemesView . IsShowingControlSchemeView )
392373 Save ( isAutoSave : true ) ;
393374 #endif
394375
@@ -534,7 +515,7 @@ public void OnAssetImported()
534515 }
535516
536517 // We set shouldClearRootVisualElement to false here as we don't want the root visual element's child elements to be closed during an auto save.
537- SetAsset ( AssetDatabase . LoadAssetAtPath < InputActionAsset > ( assetPath ) , shouldClearRootVisualElement : false ) ;
518+ SetAsset ( AssetDatabase . LoadAssetAtPath < InputActionAsset > ( assetPath ) ) ;
538519 }
539520
540521 #endregion
0 commit comments