-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 duplicated chilren in Scene spawn #904
Conversation
@Moxinilian the CI error is very strange can you force a re-run to see if fixes? |
This is an issue with all CI currently, I don't have permission to do anything about it. I'll make sure cart is aware. |
0e10753
to
7413e32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a reasonable short term fix. I made one small change (see comment below)
} | ||
} | ||
|
||
impl DerefMut for Children { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need some way to re-order children. order already matters for things like UI, and once we have an editor it will matter for "scene organization".
I added this to enable those scenarios:
children.swap(a_index, b_index);
Fixes #889,
TLDR;
The Problem
Children
component while spawning a scenetransform_propagate_system
took 13ms in release with a small skeleton tree ~20 bonesScene
is usingWorldBuilder.with(Parent(...))
(still wrong for other reasons)The Fix
FromResources
andMapEntities
forPrevousParent
Children
using adebug_assert
Children.0
andPreviousParent.0
are nowpub(crate)
, their contents are a reflect ofParent
Conclusion
This is the best short term fix, it will make so that the only true correct way of creating
Scene
will beWorldBuilder.with_children
which has no caviats