bevy/crates/bevy_asset/src
Gino Valente 6df65a2aa8
bevy_asset: Add LoadContext::get_handle_untyped (#8470)
# Objective

Currently, there isn't a clean way of getting an untyped handle to an
asset during asset loading. This is useful for when an asset needs to
reference other assets, but may not know the concrete type of each
asset.

We could "hack" this together by just using some random asset:

```rust
// We don't care what `bar.baz` is, so we "pretend" it's an `Image`
let handle: Handle<Image> = load_context.get_handle("foo/bar.baz");
```

This should work since we don't actually care about the underlying type
in this case. However, we can do better.

## Solution

Add the `LoadContext::get_handle_untyped` method to get untyped handles
to assets.
2023-04-25 19:32:34 +00:00
..
diagnostic Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
io Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
asset_server.rs Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
assets.rs Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
debug_asset_server.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
filesystem_watcher.rs Fix hot reloading for read_asset_bytes (#6797) 2023-03-02 02:51:06 +00:00
handle.rs Remove unnecessary Default impl of HandleType (#7472) 2023-02-02 15:09:06 +00:00
info.rs docs: Full documentation for bevy_asset (#3536) 2022-07-12 15:44:09 +00:00
lib.rs Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00
loader.rs bevy_asset: Add LoadContext::get_handle_untyped (#8470) 2023-04-25 19:32:34 +00:00
path.rs Add From<String> for AssetPath<'a> (#6337) 2022-10-24 14:14:24 +00:00
reflect.rs Fixed several missing links in docs. (#8117) 2023-04-23 17:28:36 +00:00