[WIP] Implement better EntityPath #12892
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Previously there's
EntityPath
inbevy_animation
which is just aVec<Name>
to refer to an entity for animation.I was trying to work on something else and thought that
EntityPath
could actually its own thing for general usages in Bevy. Inspired by Godot'sNodePath
.EntityPath
. You can refer to them by path (like in Godot!)EntityPath
could be used when you don't know the entity id ahead of time.EntityPath
can be relative to the entity and the scene.I want to implement the Godot's unique name feature too but seems like this should be a separated PR.
I'm working on this in another personal repository to keep my RA sane and also in case this is not merge and can be a mod crate.
Objective
Adds
EntityPath
that will operates on theName
component with additional enum variant.EntityPath
can:Name
component.Find an entity relative to scene's root.Should be in alternate PR/crate