pub fn add_visibility_class<C>(world: DeferredWorld<'_>, _: HookContext)where
C: 'static,
Expand description
A generic component add hook that automatically adds the appropriate
VisibilityClass
to an entity.
This can be handy when creating custom renderable components. To use this hook, add it to your renderable component like this:
ⓘ
#[derive(Component)]
#[component(on_add = add_visibility_class::<MyComponent>)]
struct MyComponent {
...
}