Search Unity

New Input System: Save Overrides

Discussion in 'Input System' started by Deleted User, Jan 19, 2019.

  1. Deleted User

    Deleted User

    Guest

    How to save the overrides, done by PerformInteractiveRebinding() between sessions?
     
    Last edited by a moderator: Jan 19, 2019
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    ATM we have no nice APIs for that yet. Ultimately, there's going to be helpers around this.

    Basically, what you'd need to do is store the ID of each action (InputAction.id) and the override path (InputBinding.overridePath). And then, when restoring the customizations, you'd look up the actions by ID and restore the override paths.

    When this is in its final form, there'll be a single API to get a serializable string and another single API to restore the customizations from such a string in one call.
     
  3. Lavidimus

    Lavidimus

    Joined:
    Sep 27, 2011
    Posts:
    75
    It's been a while, was this ever added or do we need to roll our own solution?
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Unfortunately, we didn't manage to wrap this up in time for 1.0. So ATM it's down to reading out and storing overrides manually.
     
  5. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    @Rene-Damm Any chance it'll land during the 2020.1 cycle? I have time until release and would be nice to delegate implementing this feature to you guys.

    Thanks for all the hard work. I think it'll pay off!
     
  6. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Hard to predict at this point. My assumption is feature work will resume within a month or so. Not sure in what order things will happen, though. Shooting purely from the hip, I'd say that yes there's a good chance it'll land during the 2020.1 cycle. But... it's a prediction based on very little available information, unfortunately.

    Still, finishing up the rebinding apparatus to provide more than just the basics is high on my list of want-to-get-around-to-doing things :)
     
    SugoiDev likes this.
  7. Wiechering

    Wiechering

    Joined:
    Jun 22, 2015
    Posts:
    9
    I would like to bother you for an update on this issue if that's ok :)

    Alternatively I would love if someone could help me out with a code example.
     
    Last edited: Mar 6, 2020
  8. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    A bigger extension to the rebinding apparatus has landed including a sample for a rebinding screen.

    An API to save and restore overrides is on the list for after 1.0 which we're still in the process of wrapping up. I've posted some code for how to manually save and restore overrides here.
     
  9. Wiechering

    Wiechering

    Joined:
    Jun 22, 2015
    Posts:
    9
    You are an angel :)
     
  10. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779