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

Fix missing component Add event, and raise Remove event when destroying entities. #196

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

Epicguru
Copy link
Contributor

@Epicguru Epicguru commented Jan 8, 2024

As raised in issue #194.

This adds the missing ComponentAdded event call when using the entity Create method that takes in Span<ComponentType> (which also affects the params ComponentType[] overload).

This PR also makes it so that destroying an entity also raises the ComponentRemoved event for each component on the entity.
This event is raised before the EntityDestroyed event.
I believe this brings it in line with the behaviour of Create raising the ComponentAdded event.

Unit tests for the new behaviour are included.
Thanks.

Copy link
Owner

@genaray genaray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks a lot! :)

@genaray genaray merged commit dc49bc1 into genaray:master Jan 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants