-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
feat: Trigger - access to action's actor #3157
Comments
I'm interested in giving this issue a try!
|
@Autsider666 all yours!
That's a tough one, I think the best we say is that Rough possible sketch, may or may not compile, but types should be inferred? class Trigger<TActionTarget extends Entity = Entity> {
constructor(public targetType: typeof TActionTarget) => {}
onFilter<TEntity extends Entity>(entity: TEntity): TActionTarget {
if (entity instanceof this.targetType) {
return entity
}
..
}
onAction(actionTarget: TActionTarget) {
}
}
|
Discussed in #3099
Originally posted by KostarSf June 17, 2024
Hi! It would be very useful to have access to the Actor, which calls Trigger's action callback. Something like this:
I want to use triggers as areas of view for AI enemies, so it's important for me to know which Actor called action. Now I have to do my own implementation of the trigger, which takes this into account.
It would be great if it appeared in Excalibur!
The text was updated successfully, but these errors were encountered: