diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 1a8cd8269e..28f04496db 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -15,6 +15,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed an issue where a composite binding would not be consecutively triggered after ResetDevice() has been called from the associated action handler [ISXB-746](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-746). - Fixed resource designation for "d_InputControl" icon to address CI failure. - Fixed an issue where a composite binding would not be consecutively triggered after disabling actions while there are action modifiers in progress [ISXB-505](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-505). +- Fixed issue where all action maps default to enabled when InputSystem is enabled [ISXB-621](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-621). Now, only the default map is enabled. ## [1.8.2] - 2024-04-29 diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs index 0dbfc82e16..19a82c7bad 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs @@ -984,7 +984,21 @@ public void SwitchCurrentActionMap(string mapNameOrId) return; } + if (currentActionMap == null) + { + //Disabling all action maps, because we don't know which one is currently enabled + foreach (var i in m_Actions.actionMaps) + { + i.Disable(); + } + } + else + { + //Disabling the currently enabled action map + currentActionMap.Disable(); + } currentActionMap = actionMap; + currentActionMap.Enable(); } /// @@ -1621,6 +1635,11 @@ void Reset() #endif + private void Start() + { + ActivateInput(); + } + private void OnEnable() { m_Enabled = true; @@ -1630,7 +1649,6 @@ private void OnEnable() AssignPlayerIndex(); InitializeActions(); AssignUserAndDevices(); - ActivateInput(); } // Split-screen index defaults to player index.