-
Is there a way to access an entt::entity that is generating the signal when on_construct or on_destroy is called? At the moment I have something as follows: entt::sink seqlinkOnDestroy = m_Registry.on_destroy() I am trying to see if it is possible to get the entity ID of the entity whose component was destroyed when SeqLinkComp is removed and SeqLinkDestroyed() is called. I read through "Crash Course : entity-component system" discussing the reactivity of entt and I also read through "Crash Course: events, signals, and everything in between," but I am struggling to piece together the right way to think about signals in entt. In addition, I am not particularly advanced so I may be missing something obvious. Any help or direction would be very much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Yes, you should be able too. example code i use:
this actually calls the .remove<>(e) method on the registry. the wiki also tells you the signature you can have:
https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#observe-changes |
Beta Was this translation helpful? Give feedback.
-
I do not follow your response. I have read through the link you provided, but no luck. Is it possible to retrieve the entity ID from within the connected method? |
Beta Was this translation helpful? Give feedback.
Yes, you should be able too. example code i use:
this actually calls the .remove<>(e) method on the registry.
the wiki also tells you the signature you can have:
https://github.com/skypjack/entt/wiki/Crash-Course:-entity-component-system#observe-changes