bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.4k stars 3.49k forks source link

Add example for asset dependencies #8569

Open undersquire opened 1 year ago

undersquire commented 1 year ago

How can Bevy's examples be improved?

https://docs.rs/bevy/latest/bevy/asset/struct.LoadedAsset.html

For my project I have been relying on systems to do nested loading of assets, but asset dependencies simplify this greatly. However, Bevy currently has no examples regarding asset dependencies (which is probably why I never noticed the feature haha).

Bevy should add an example(s) of the asset dependency system.

MrGVSV commented 1 year ago

Specifically, I think we should have an example(s) that showcases both LoadedAsset::with_dependency (possibly in conjunction with LoadContext::get_handle) as well as LoadContext::set_labeled_asset and LoadContext::read_asset_bytes.

If not both, then at least the first one as I feel that's the one that's more likely to be useful (i.e. loading another asset by path).