Skip to content

Accessing an entity ID from entt::connection created from on_construct (on_destroy)? #967

Answered by Green-Sky
hiraz01 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you should be able too. example code i use:

scene.on_destroy<Components::Position2D>().connect<&entt::registry::remove<Components::Transform4x4>>();

this actually calls the .remove<>(e) method on the registry.

the wiki also tells you the signature you can have:

void(entt::registry &, entt::entity);

https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#observe-changes

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by hiraz01
Comment options

You must be logged in to vote
6 replies
@Green-Sky
Comment options

@hiraz01
Comment options

@skypjack
Comment options

@hiraz01
Comment options

@skypjack
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
discussion it sounds interesting, let's discuss it
3 participants