bevy-asset-scenes
Installation
SKILL.md
Contains Shell Commands
This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.
Bevy asset scenes
When to use
Load this when content comes from disk or a scene description should spawn entities. bevy::asset and bevy::scene on docs.rs latest (0.20.0) are the sources.
ECS shape
- Assets:
AssetServeris the resource that loads from disk.AssetServer::loadreturns aHandleand does not reload while a strong handle still exists. Loaded data lives inAssets<T>.AssetServer::is_loaded_with_dependenciesis true when the asset and its dependencies are ready.LoadStateis the status type named on that page. - Handles: strong handles are reference counted. Dropping the last strong handle removes the asset. Weak handles do not keep it alive.
Assets::addinserts a procedural asset and does not deduplicate. - Hot reload: the
file_watcherCargo feature, andAssetPlugin'swatch_for_changes_overridefield, are the toggles named on the asset index. - Scenes:
bevy::scenedescribes aScene(entity, components, children, assets), built with thebsn!macro.World::spawn_sceneandCommands::spawn_scenespawn immediately and error if asset dependencies are not loaded.World::queue_spawn_sceneandCommands::queue_spawn_scenewait, then spawn in theSpawnSceneschedule betweenUpdateandPostUpdate. - Hierarchy in a scene:
Children [ ... ]insidebsn!. Separate sibling entities with--.#Nameassigns aNameinside that macro's scope.