@@ -11,11 +11,12 @@ internal static class PriorityTestExtensions
1111{
1212 internal static InputAction SetupTestAction ( this InputActionMap map , string [ ] bindings )
1313 {
14+ var actionTag = string . Join ( "+" , bindings ) ;
1415 switch ( bindings . Length )
1516 {
1617 case 1 :
1718 {
18- var action = map . AddAction ( "Action1:" + bindings [ 0 ] + " " + Guid . NewGuid ( ) ) ;
19+ var action = map . AddAction ( $ "Action { actionTag } " ) ;
1920 action . AddBinding ( "<Keyboard>/" + bindings [ 0 ] ) ;
2021 return action ;
2122 }
@@ -25,7 +26,7 @@ internal static InputAction SetupTestAction(this InputActionMap map, string[] bi
2526 var modifier = bindings [ 0 ] ;
2627 var binding = bindings [ 1 ] ;
2728
28- var action = map . AddAction ( "Action2:" + modifier + " " + binding + " " + Guid . NewGuid ( ) ) ;
29+ var action = map . AddAction ( $ "Action { actionTag } " ) ;
2930
3031 action . AddCompositeBinding ( "OneModifier" )
3132 . With ( "Modifier" , "<Keyboard>/" + modifier )
@@ -40,9 +41,8 @@ internal static InputAction SetupTestAction(this InputActionMap map, string[] bi
4041 var modifier2 = bindings [ 1 ] ;
4142 var binding = bindings [ 2 ] ;
4243
43- var action = map . AddAction ( "Action3:" + modifier1 + " " + modifier2 + " " + binding + " " + Guid . NewGuid ( ) ) ;
44+ var action = map . AddAction ( $ "Action { actionTag } " ) ;
4445
45- // A shortcut with two modifiers
4646 action . AddCompositeBinding ( "TwoModifiers" )
4747 . With ( "Modifier1" , "<Keyboard>/" + modifier1 )
4848 . With ( "Modifier2" , "<Keyboard>/" + modifier2 )
@@ -71,21 +71,18 @@ private void PressBindingsForInputActions(Keyboard keyboard, InputAction action1
7171 {
7272 for ( int i = 0 ; i < action1 . controls . Count ; i ++ )
7373 {
74- Debug . Log ( "action 1 binding pressed: " + action1 . controls [ i ] . path ) ;
7574 Press ( ( ButtonControl ) action1 . controls [ i ] , queueEventOnly : true ) ;
7675 }
7776
7877 for ( int i = 0 ; i < action2 . controls . Count ; i ++ )
7978 {
80- Debug . Log ( "action 2 binding pressed: " + action2 . controls [ i ] . name ) ;
8179 Press ( ( ButtonControl ) action2 . controls [ i ] , queueEventOnly : true ) ;
8280 }
8381
8482 if ( action3 != null )
8583 {
8684 for ( int i = 0 ; i < action3 . controls . Count ; i ++ )
8785 {
88- Debug . Log ( "action 3 binding pressed: " + action3 . controls [ i ] . name ) ;
8986 Press ( ( ButtonControl ) action3 . controls [ i ] , queueEventOnly : true ) ;
9087 }
9188 }
0 commit comments