Adding More Comments to the Embedded Assets Example (#17865)
# Objective I noticed when I was looking at the embedded assets example that there wasn't any comments on it to indicate what an embedded asset is and why anyone would want to make one. ## Solution I added some more comments to the example that gives more detail about embedded assets and how they work. Feel free to be aggressive with rewriting these comments however, I just think the example could use something haha. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
f7b2a02224
commit
fa85a14de1
@ -1,5 +1,11 @@
|
||||
//! Example of loading an embedded asset.
|
||||
|
||||
//! An embedded asset is an asset included in the program's memory, in contrast to other assets that are normally loaded from disk to memory when needed.
|
||||
//! The below example embeds the asset at program startup, unlike the common use case of embedding an asset at build time. Embedded an asset at program startup can be useful
|
||||
//! for things like loading screens, since it might be nice to display some art while other, non-embedded, assets are loading.
|
||||
|
||||
//! One common use case for embedded assets is including them directly within the executable during its creation. By embedding an asset at build time rather than runtime
|
||||
//! the program never needs to go to disk for the asset at all, since it is already located in the program's binary executable.
|
||||
use bevy::{
|
||||
asset::{embedded_asset, io::AssetSourceId, AssetPath},
|
||||
prelude::*,
|
||||
|
Loading…
Reference in New Issue
Block a user