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:

  1. The very basic SceneHook, it has a hook 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.
  2. The more advanced reload::Hook. Which works like SceneHook, but is aware of reload state, and also has access to the ECS &World and the root Entity of the scene it is running for.

The the respective documentation of SceneHook and reload::Hook for usage examples.

Modules§

reload
Defines reloading Hooks and supporting system.

Structs§

HookPlugin
Plugin to run hooks associated with spawned scenes.
HookedDynamicSceneBundle
Bundle a SceneHook with dynamic scenes DynamicSceneBundle components.
HookedSceneBundle
Bundle a SceneHook with the standard SceneBundle components.
HookedSceneState
Convenience parameter to query if a scene marked with M has been loaded.
SceneHook
Add this as a component to any entity to run hook when the scene is loaded.
SceneHooked
Marker Component for scenes that were hooked.

Enums§

Systems
Systems defined in the bevy_scene_hook crate (this crate).

Functions§

is_scene_hooked
Convenience run criteria to query if a scene marked with M has been loaded.
run_hooks
Run once SceneHooks added to SceneBundle or DynamicSceneBundle when the scenes are loaded.