diff --git a/crates/bevy_asset/src/assets.rs b/crates/bevy_asset/src/assets.rs index bcb2cb7bf0..cc1ee6bf09 100644 --- a/crates/bevy_asset/src/assets.rs +++ b/crates/bevy_asset/src/assets.rs @@ -299,6 +299,11 @@ impl Assets { self.handle_provider.clone() } + /// Reserves a new [`Handle`] for an asset that will be stored in this collection. + pub fn reserve_handle(&self) -> Handle { + self.handle_provider.reserve_handle().typed::() + } + /// Inserts the given `asset`, identified by the given `id`. If an asset already exists for `id`, it will be replaced. pub fn insert(&mut self, id: impl Into>, asset: A) { let id: AssetId = id.into();