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.
Objective
in rendering we are increasingly moving from resources to components attached to the camera entity. each time we do this, we worry about how people (and editors) will find the components.
find a nice way to identify components that can be attached to entities with specific other components.
Solution
add
#[derive(PairsWithOthers)]
to a component to specify it as a component that likes other things added alongside it. this generates aPairsWithXXX
trait that can be linked from the docs for the component. see e.g. Camera3dBundle:add
#[pairs_with(YYY)]
to components that want to be on an entity with XXX. this generates an impl of the trait. then the components can be found on the doc page:PairsWithXXX
trait - currently this uses a string lookup inpairs.rs
which would need to be updated for each newPairsWithOthers
type. Might not be too bad as there are not many of them.pairs_with
for many other components (suggestions pls).