Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

FIX: Errors are thrown when assigning Input Actions Asset that contains a custom InputProcessor or InputBindingComposite as Project-wide Input Actions (ISXB-856) #1958

Closed bmalrat closed 2 weeks ago

bmalrat commented 2 months ago

Description

The static registration of custom processor, interaction, BindingComposite could lead to undefined behavior for project action if the static initiation doesn't occur in the right order which is by design hard to control.

Changes made

Add reflection to load custom InputProcessor, IInputInteraction and InputBindingComposite during the InputManage initialisation. Added a profiler marker for this step.

Testing

local test + bug project

Risk

It add some time in the initialisation and register all derived type which was not the case before. We may encounter some name collision and he doesn't have a way to disable the automatic discovery.

Checklist

Before review:

During merge:

After merge: