Conversation
|
I can see this being useful in the future, but codegen for the sake of docs seems backwards. Wonder if this could (for now) just generate a |
do you mean generate a doc attribute on the camera (for example) from the other components? i did try to |
Yeah, that's what I would want. If needed we can probably get an appropriate attribute added upstream too. |
|
sorry but i've got absolutely no idea how i could do that. |
|
Yeah; I'll ask around for solutions here. Going to close this out, but I'm chewing on this problem. |
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 aPairsWithXXXtrait 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:PairsWithXXXtrait - currently this uses a string lookup inpairs.rswhich would need to be updated for each newPairsWithOtherstype. Might not be too bad as there are not many of them.pairs_withfor many other components (suggestions pls).