Search Unity

Simple way to deactivate inputs and reactivate in its previous state ?

Discussion in 'Input System' started by anthonov, Oct 31, 2020.

  1. anthonov

    anthonov

    Joined:
    Sep 24, 2015
    Posts:
    160
    Let's say we have an input action asset and we set some action map to Enable(), some to Disabled(), and some actions to Enable().
    How to deactivate all input on this specific player, then reactivate all of it in its previous state ?
    Since enabling and disabling action maps and actions asset affect all their actions children, then how to restore the state before that ?
    Docs says there is a function on PlayerInput to Activate and Deactivate all input, but it does not restore past state, and in fact, it affect only the current action map so I don't get the point of this function.

    I would like a new feature : a parameter with Enabling and Disabling action maps and actions asset : to control and restore previous state, like this :
    fightMap.Disabled()
    fightMap.Enabled(affect all = bool)
    I will take all suggestion if I missed something.
     
    Last edited: Oct 31, 2020
    rimmarpl likes this.