Skip to content

How to achieve a event system? #111

Answered by sebas77
Imitater967 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

in DOTS ECS, when you add a new component to an entity, you are effectively moving the entity to a different subset. This is indeed the way to handle change of behaviours. If a new behaviour must be applied to an entity, it should be found into another subset.

In Svelto you can create subsets with groups and filters. GroupCompounds help handing multiple states at once. A group compound handles up to 4 states, where the first 1 is usually the type of entity itself. So usually you can handle 3 different states at once.
While you can iterate entities found in specific groups, it's also possible to rely on the IReactOnSwapEx callbacks to react on specific change of state once.

When thi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Imitater967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
FAQ Svelto FAQs
2 participants