Crate bevy_scene_hook
source ·Expand description
Systems to insert components on loaded scenes.
Hooks allow you to run code on a scene after loading it. It provides an API
similar to the bevy [SceneBundle
], but with the ability to add components
to scene entities once they are loaded.
This crate has two hook types:
- The very basic
SceneHook
, it has ahook
function field. It will run once per entity within the scene, with the ability to add new components to the entity and read its existing components. - The more advanced
reload::Hook
. Which works likeSceneHook
, but is aware of reload state, and also has access to the ECS&World
and the rootEntity
of the scene it is running for.
The the respective documentation of SceneHook
and reload::Hook
for
usage examples.
Modules§
- Defines reloading
Hook
s and supporting system.
Structs§
- Plugin to run hooks associated with spawned scenes.
- Bundle a
SceneHook
with dynamic scenes [DynamicSceneBundle
] components. - Bundle a
SceneHook
with the standard [SceneBundle
] components. - Convenience parameter to query if a scene marked with
M
has been loaded. - Add this as a component to any entity to run
hook
when the scene is loaded. - Marker Component for scenes that were hooked.
Enums§
- Systems defined in the
bevy_scene_hook
crate (this crate).
Functions§
- Convenience run criteria to query if a scene marked with
M
has been loaded.