I’m new to using Action Maps in the Input System Package and trying to write a manager to either enable or disable action maps as needed when called on by external classes (it’s a static class).
To do this, I’m using the following functions:
public static void ChangePrimaryActionMap(string name)
{
DisableActionMap(PrimaryActionMap);
SetPrimaryActionMap(name);
}
public static void SetPrimaryActionMap(string name)
{
PrimaryActionMap = name;
EnableActionMap(PrimaryActionMap);
}
public static void DisableActionMap(string name)
{
sortedInputReceivers[name].EnableInputs(false);
}
public static void EnableActionMap(string name)
{
sortedInputReceivers[name].EnableInputs();
}
Now, does this work? Technically yes. However, it causes a strange error that I don’t even know what it means, and that’s why I’m asking here.
Should not get here
UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
Should not get here
UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass10_0:<set_onBeforeUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType)
UnityEngineInternal.Input.NativeInputSystem:NotifyBeforeUpdate (UnityEngineInternal.Input.NativeInputUpdateType)
Should not get here
UnityEditor.EditorApplicationLayout:SetPausemodeLayout ()
And that’s just so far, it’s possible more may come the more I test it, but with collapse on and after getting 16 errors, they’re all one of those 3 and they all pause the playmode when it occurs too. Any assistance would be greatly appreciated. I’m sure I must be switching action maps incorrectly, but truly I don’t know what the problem is. That’s my best guess. (for additional context, I’m using the generated C# class for my input receivers.