@@ -87,11 +87,19 @@ public static VisualElement CreateMakeActiveGui<T>(T current, T target, string t
8787 where T : ScriptableObject
8888 {
8989 var container = new VisualElement ( ) ;
90+ PopulateMakeActiveGui ( container , current , target , entity , apply , allowAssignActive ) ;
91+ return container ;
92+ }
93+
94+ private static void PopulateMakeActiveGui < T > ( VisualElement container , T current , T target , string entity , Action < T > apply , bool allowAssignActive )
95+ where T : ScriptableObject
96+ {
97+ container . Clear ( ) ;
9098
9199 if ( current == target )
92100 {
93101 container . Add ( new HelpBox ( $ "These actions are assigned as the { entity } .", HelpBoxMessageType . Info ) ) ;
94- return container ;
102+ return ;
95103 }
96104
97105 string currentlyActiveAssetsPath = null ;
@@ -104,14 +112,16 @@ public static VisualElement CreateMakeActiveGui<T>(T current, T target, string t
104112 $ "These actions are not assigned as the { entity } for the Input System. { currentlyActiveAssetsPath ?? "" } ",
105113 HelpBoxMessageType . Warning ) ) ;
106114
107- var assignButton = new Button ( ( ) => apply ( target ) )
115+ var assignButton = new Button ( ( ) =>
116+ {
117+ apply ( target ) ;
118+ PopulateMakeActiveGui ( container , target , target , entity , apply , allowAssignActive ) ;
119+ } )
108120 {
109121 text = $ "Assign as the { entity } "
110122 } ;
111123 assignButton . SetEnabled ( allowAssignActive ) ;
112124 container . Add ( assignButton ) ;
113-
114- return container ;
115125 }
116126
117127 public static bool IsValidFileExtension ( string path )
0 commit comments