mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 13:13:49 +00:00
6df65a2aa8
# 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. |
||
---|---|---|
.. | ||
diagnostic | ||
io | ||
asset_server.rs | ||
assets.rs | ||
debug_asset_server.rs | ||
filesystem_watcher.rs | ||
handle.rs | ||
info.rs | ||
lib.rs | ||
loader.rs | ||
path.rs | ||
reflect.rs |