Skip to content

Conversation

@FredrikNoren
Copy link
Contributor

This fixes client-server synchronization of hierarchies; instead of synchronizing the children we now only synchronize parent and instead construct children based on parents. (Re. #843 )


## Opting out of automatically derived children

If you whish to manage the `children` component yourself, you can attach an `unmanaged_children` component to your
Copy link
Contributor

Choose a reason for hiding this comment

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

wish

children.retain(|x| *x != child)
});
if has_component(entity, unmanaged_children()) {
if has_component(entity, children()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this if not necessary, mutate_component does nothing if it doesn't have that component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@philpax Hm yeah, it feels like the mutate_component etc. should return Results, so it's up to the user to handle situations like that? Then it could just be .ok() on it to ignore the result.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's the plan with #230 / #773, but mutate_component already returns an Option<T> with the resulting value; you can check for None if you want

@FredrikNoren FredrikNoren merged commit f489c77 into main Sep 12, 2023
@philpax philpax deleted the derived-children branch September 12, 2023 14:42
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.

3 participants