Skip to content

Commit c513dca

Browse files
committed
moved disable of all maps - removed not necessary enabled check from switch current action map
1 parent d65c853 commit c513dca

File tree

1 file changed

+4
-12
lines changed
  • Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput

1 file changed

+4
-12
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInput.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,6 @@ public void ActivateInput()
954954

955955
m_InputActive = true;
956956

957-
// reset state to default, only one action map is enabled at the initial state
958-
// Project wide actions may have enabled action maps
959-
if (m_Actions)
960-
m_Actions.Disable();
961-
962957
// If we have no current action map but there's a default
963958
// action map, make it current.
964959
if (m_CurrentActionMap == null && m_Actions != null && !string.IsNullOrEmpty(m_DefaultActionMap))
@@ -1112,13 +1107,6 @@ public void SwitchCurrentControlScheme(string controlScheme, params InputDevice[
11121107
/// <seealso cref="InputActionMap"/>
11131108
public void SwitchCurrentActionMap(string mapNameOrId)
11141109
{
1115-
// Must be enabled.
1116-
if (!m_Enabled)
1117-
{
1118-
Debug.LogError($"Cannot switch to actions '{mapNameOrId}'; input is not enabled", this);
1119-
return;
1120-
}
1121-
11221110
// Must have actions.
11231111
if (m_Actions == null)
11241112
{
@@ -1382,6 +1370,10 @@ private void InitializeActions()
13821370
m_Actions.actionMaps[actionMap].ApplyBindingOverride(binding, oldActions.actionMaps[actionMap].bindings[binding]);
13831371
}
13841372

1373+
// reset state to default, only one action map is enabled at the initial state
1374+
// Project wide actions may have enabled action maps
1375+
m_Actions.Disable();
1376+
13851377
#if UNITY_INPUT_SYSTEM_ENABLE_UI
13861378
if (uiInputModule != null)
13871379
uiInputModule.actionsAsset = m_Actions;

0 commit comments

Comments
 (0)