bevy
bevy copied to clipboard
Gltf update: use instance iteration instead of hierarchy iteration
Objective
- Improve example on how to use the
SceneBundle
to iterate on entities in the scene instance spawned
Solution
- Use the scene instance and
iter_instance_entities
- Also improves a little the method and doc
I intentionally moved this example to interact with the actual components + hierarchy, as that is the pattern I think we should be encouraging people to use. Encouraging that pattern seems preferable to iterating a list that happens to render this specific example slightly better.
I do like the improvement to the iterator api though.
I intentionally moved this example to interact with the actual components + hierarchy
Ha I looked into git blame and was the one who last modified that but I had no memory of it, that explains it 😄 For me, doing it through the hierarchy takes it away from "scene update" of the example, and to another "hierarchy update". If we don't showcase the function made to iterate all entities in a scene spawned in this example, maybe that function isn't useful...