mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
78b5e49202
# Objective - Sometimes, it is useful to get a `Handle<T>` from an `AssetId<T>`. For example, when iterating `Assets` to find a specific asset. So much so that it's possible to do so with `AssetServer::get_id_handle` - However, `AssetServer::get_id_handle` doesn't work with assets directly added to `Assets` using `Assets::add`. - Fixes #12087 ## Solution - Add `Assets::get_strong_handle` to convert an `AssetId` into an `Handle` - Document `AssetServer::get_id_handle` to explain its limitation and point to `get_strong_handle`. - Add a test for `get_strong_handle` - Add a `duplicate_handles` field to `Assets` to avoid dropping assets with a live handle generated by `get_strong_handle` (more reference counting yay…) - Fix typos in `Assets` docs --- ## Changelog - Add `Assets::get_strong_handle` to convert an `AssetId` into an `Handle` |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |