Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 21 commits into from
Aug 19, 2024

Conversation

bmalrat
Copy link
Collaborator

@bmalrat bmalrat commented Jul 2, 2024

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:

  • [ X] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [ X] Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

After merge:

  • Create forward/backward port if needed. If you are blocked from creating a forward port now please add a task to ISX-1444.

@bmalrat bmalrat force-pushed the isxb-856-fix-editor-project-wide-actions branch 3 times, most recently from 2b95f08 to db17eb0 Compare July 9, 2024 14:22
@bmalrat bmalrat force-pushed the isxb-856-fix-editor-project-wide-actions branch from c1d97f6 to 7e1682b Compare August 2, 2024 07:20
@bmalrat bmalrat force-pushed the isxb-856-fix-editor-project-wide-actions branch from 700e766 to 486923b Compare August 5, 2024 17:03
RegisterCustomTypes();
}

void RegisterCustomTypes(Type[] types)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure to add a ProfilerMarker to track how long this takes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea I will add that

Copy link
Collaborator

@jfreire-unity jfreire-unity Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that sounds good. @chris-massie are you concerned with startup times with this change?

@bmalrat bmalrat marked this pull request as ready for review August 7, 2024 07:50
@bmalrat bmalrat requested a review from ekcoh August 13, 2024 07:47
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement, LGTM!

fixed changelog order
@bmalrat bmalrat merged commit ab2c3d7 into develop Aug 19, 2024
76 of 79 checks passed
@bmalrat bmalrat deleted the isxb-856-fix-editor-project-wide-actions branch August 19, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants