bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Gltf update: use instance iteration instead of hierarchy iteration

Open mockersf opened this issue 1 year ago • 2 comments

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

mockersf avatar Jul 23 '22 12:07 mockersf

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.

cart avatar Aug 01 '22 00:08 cart

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...

mockersf avatar Aug 01 '22 01:08 mockersf