Skip to content

Commit

Permalink
Doc-comment of AssetServer::load has been improved
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsweeper committed May 8, 2024
1 parent 77ed72b commit dead8ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/bevy_asset/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ impl AssetServer {
/// it returns a "strong" [`Handle`]. When the [`Asset`] is loaded (and enters [`LoadState::Loaded`]), it will be added to the
/// associated [`Assets`] resource.
///
/// In case the file path contains a hash, the `path` must be specified explicitly,
/// because otherwise hash would be interpreted as separator between file path and subasset name, for example:
/// `asset_server.load(Path::new("some/file#path"));`
/// or there must be set the label of subasset, if `AssetServer` should load subasset, for example:
/// `asset_server.load(AssetPath::from_path(Path::new("some/file#path")).with_label("subasset"));`
///
/// You can check the asset's load state by reading [`AssetEvent`] events, calling [`AssetServer::load_state`], or checking
/// the [`Assets`] storage to see if the [`Asset`] exists yet.
///
Expand Down

0 comments on commit dead8ea

Please sign in to comment.