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

ComponentAddedHandler or ComponentChangedHandler are not called for Components of the world #165

Closed
danielscherzer opened this issue Jun 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@danielscherzer
Copy link

danielscherzer commented Jun 30, 2022

Thanks for your amazing library.

I want to monitor addition of a bool component to the world:

using World world = new();
bool called = false;
world.SubscribeComponentAdded((in Entity _, in bool b) => called = b);
world.Set(true);

When I execute the code called should be true, but it is false.

If I do the same for an entity

using World world = new();
bool called = false;
world.SubscribeComponentAdded((in Entity _, in bool b) => called = b);
var e = world.CreateEntity();
e.Set(true);

called is set to true, as expected. Is this the intended behaviour or is this a bug?

Thanks for your time,
Daniel

@Doraku
Copy link
Owner

Doraku commented Jul 1, 2022

hum I didn't add subscriptions for world components but it wouldn't be too hard to do (as the current subscription is only for entity components) so for now it is intended ^^". Thanks for the feed back :)

@Doraku Doraku added the enhancement New feature or request label Jul 1, 2022
@Doraku Doraku closed this as completed in 3c565bb Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants