bevy_scene: Add ReflectBundle#9165
Conversation
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
|
Note: My approval should probably be taken with a grain of salt as this code is based on #6344 (not trying to intentionally dupe the reviewer system lol) |
nicopap
left a comment
There was a problem hiding this comment.
There is a few issues with this code:
- how much the implementation duplicates
ReflectComponent - how many failure cases we have. A lot of
panic!. - The indentation is all over the place.
Performance
I did take a look at alternative implementation. Notably: could we use DynamicBundle::get_components to avoid having to recursively navigate the struct? I think yes, but it's not relevant for this PR.
Things to do for approval
The fn defined in ReflectBundleFns are very large, so it's going to bloat binaries, pretty bad for wasm.
All said. I think it's fine as of this PR, since you have to explicitly register the ReflectBundle, so no one is paying for things they don't use, at the cost of some convenience (the need to add a register_data::<Bundle, ReflectBundle>()). So I'm approving if the following are done:
- Replace the
if let … else xwithlet else x; …to avoid this rightward drift - Remove the documentation, replace them with reference to doc items in
reflect/component.rs
|
@nicopap done! |
|
I think the docs are pretty good at this point. |
|
Example |
1 similar comment
|
Example |
# Objective Similar to bevyengine#6344, but contains only `ReflectBundle` changes. Useful for scripting. The implementation has also been updated to look exactly like `ReflectComponent`. --- ## Changelog ### Added - Reflection for bundles. --------- Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
# Objective Similar to bevyengine#6344, but contains only `ReflectBundle` changes. Useful for scripting. The implementation has also been updated to look exactly like `ReflectComponent`. --- ## Changelog ### Added - Reflection for bundles. --------- Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
Objective
Similar to #6344, but contains only
ReflectBundlechanges. Useful for scripting. The implementation has also been updated to look exactly likeReflectComponent.Changelog
Added