-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Align onXYZ method signatures to match event payloads #3106
Comments
we could consider writing a codemod to help with the breaking change |
This issue hasn't had any recent activity lately and is being marked as stale automatically. |
Playing devil's advocate: What about deprecating and later removing the hardcoded |
They should definitely stay. There's a very high chance your extended actor will need to use one of those events, so it removes boilerplate by having these. It's also a familiar concept for devs coming from Unity etc. |
Ah, good to know. I'm not familiar with Unity at all, so that explains their usage. |
I could be wrong but I'm guessing it's done that way to save setting up an event listener unnecessarily in the case that the extended actor doesn't need it. |
@mattjennings How do you feel if we defer this a release to v0.31 or RC (whichever is first?) |
yup works for me! |
Context
Actors (and maybe other classes) expose methods such as
onPreUpdate
oronCollisionStart
as convenient handlers for events to avoid manually wiring up to events.However, the method signature is different than what you would get if you did manually wire up to the event.
This makes it inconvenient if I want to move code around in such a way that i'm going to/from an event handler/class method.
Proposal
This is a severely breaking change
Align all onXYZ convenience methods to use event as the parameter rather than multiple parameters from the event.
The text was updated successfully, but these errors were encountered: