@@ -391,7 +391,8 @@ public void PlayerInput_CanAssignActionsToPlayer()
391
391
var actions = InputActionAsset . FromJson ( kActions ) ;
392
392
playerInput . actions = actions ;
393
393
394
- Assert . That ( playerInput . actions , Is . SameAs ( actions ) ) ;
394
+ Assert . That ( playerInput . actions . actionMaps . Count , Is . EqualTo ( actions . actionMaps . Count ) ) ;
395
+ Assert . That ( playerInput . actions . actionMaps [ 0 ] . name , Is . EqualTo ( actions . actionMaps [ 0 ] . name ) ) ;
395
396
}
396
397
397
398
[ Test ]
@@ -407,13 +408,13 @@ public void PlayerInput_AssigningNewActionsToPlayer_DisablesExistingActions()
407
408
playerInput . defaultActionMap = "gameplay" ;
408
409
playerInput . actions = actions1 ;
409
410
410
- Assert . That ( actions1 . actionMaps [ 0 ] . enabled , Is . True ) ;
411
- Assert . That ( actions2 . actionMaps [ 0 ] . enabled , Is . False ) ;
411
+ Assert . That ( playerInput . actions . actionMaps [ 0 ] . enabled , Is . True ) ;
412
+ Assert . That ( actions1 . actionMaps [ 0 ] . enabled , Is . False ) ;
412
413
413
414
playerInput . actions = actions2 ;
414
415
415
- Assert . That ( actions1 . actionMaps [ 0 ] . enabled , Is . False ) ;
416
- Assert . That ( actions2 . actionMaps [ 0 ] . enabled , Is . True ) ;
416
+ Assert . That ( actions2 . actionMaps [ 0 ] . enabled , Is . False ) ;
417
+ Assert . That ( playerInput . actions . actionMaps [ 0 ] . enabled , Is . True ) ;
417
418
}
418
419
419
420
[ Test ]
@@ -1714,7 +1715,8 @@ InputDevice[] AddDevices()
1714
1715
1715
1716
// Make sure that no cloning of actions happened on the prefab.
1716
1717
// https://fogbugz.unity3d.com/f/cases/1319756/
1717
- Assert . That ( playerPrefab . GetComponent < PlayerInput > ( ) . actions , Is . SameAs ( playerPrefabActions ) ) ;
1718
+
1719
+ Assert . That ( playerPrefab . GetComponent < PlayerInput > ( ) . actions . actionMaps . Count , Is . EqualTo ( playerPrefabActions . actionMaps . Count ) ) ;
1718
1720
Assert . That ( playerPrefab . GetComponent < PlayerInput > ( ) . m_ActionsInitialized , Is . False ) ;
1719
1721
}
1720
1722
@@ -2421,13 +2423,13 @@ public void PlayerInput_DelegatesAreUpdate_WhenActionMapAddedAfterAssignment()
2421
2423
// Disable the asset while adding another action map to it as none
2422
2424
// of the actions in the asset can be enabled during modification
2423
2425
//
2424
- actionAsset . Disable ( ) ;
2426
+ playerInput . actions . Disable ( ) ;
2425
2427
var keyboard = InputSystem . AddDevice < Keyboard > ( ) ;
2426
- var newActionMap = actionAsset . AddActionMap ( "NewMap" ) ;
2428
+ var newActionMap = playerInput . actions . AddActionMap ( "NewMap" ) ;
2427
2429
var newAction = newActionMap . AddAction ( "NewAction" ) ;
2428
2430
newAction . AddBinding ( "<Keyboard>/k" , groups : "Keyboard" ) ;
2429
- actionAsset . AddControlScheme ( "Keyboard" ) . WithRequiredDevice < Keyboard > ( ) ;
2430
- actionAsset . Enable ( ) ;
2431
+ playerInput . actions . AddControlScheme ( "Keyboard" ) . WithRequiredDevice < Keyboard > ( ) ;
2432
+ playerInput . actions . Enable ( ) ;
2431
2433
2432
2434
playerInput . currentActionMap = newActionMap ;
2433
2435
playerInput . ActivateInput ( ) ;
0 commit comments