Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

Feature Request DeferBindingResolution - make public

Discussion in 'Input System' started by OndrejP, Apr 25, 2022.

  1. OndrejP


    Jul 19, 2017

    I'm currently using reflection to call this method:

    Code (CSharp):
    1. static readonly Func<IDisposable> m_deferBindingResolutionAcquire = typeof(InputActionRebindingExtensions).GetStaticMethod<Func<IDisposable>>("DeferBindingResolution");
    Why I need it?
    I allow movement input when UI is active (like in PUBG).
    When UI is activated I need to set device filter on certain action maps and BindingMask filters on certain actions. Deferring improves performance a lot (from ~15ms to ~3ms). It's still not ideal, but acceptable.

    In ideal world:
    Store resolved input bindings as opaque object. Then activate these previously resolved input bindings without any performance hit. Re-resolve would be needed only when user rebinds inputs or new device is connected, but that's totally fine (happens very rarely during gameplay).