bevy/crates/bevy_asset/src
andriyDev f17644879d
Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481)
# Objective

Fixes #15417.

## Solution

- Remove the `labeled_assets` fields from `LoadedAsset` and
`ErasedLoadedAsset`.
- Created new structs `CompleteLoadedAsset` and
`CompleteErasedLoadedAsset` to hold the `labeled_subassets`.
- When a subasset is `LoadContext::finish`ed, it produces a
`CompleteLoadedAsset`.
- When a `CompleteLoadedAsset` is added to a `LoadContext` (as a
subasset), their `labeled_assets` are merged, reporting any overlaps.

One important detail to note: nested subassets with overlapping names
could in theory have been used in the past for the purposes of asset
preprocessing. Even though there was no way to access these "shadowed"
nested subassets, asset preprocessing does get access to these nested
subassets. This does not seem like a case we should support though. It
is confusing at best.

## Testing

- This is just a refactor.

---

## Migration Guide

- Most uses of `LoadedAsset` and `ErasedLoadedAsset` should be replaced
with `CompleteLoadedAsset` and `CompleteErasedLoadedAsset` respectively.
2025-02-10 21:06:37 +00:00
..
io Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
processor Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
server Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
asset_changed.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
assets.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
direct_access_ext.rs Add methods to directly load assets from World (#12023) 2024-02-27 00:28:26 +00:00
event.rs fix: add reflect to SceneInstanceReady and other observers/events (#16018) 2024-10-20 13:51:41 +00:00
folder.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
handle.rs Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
id.rs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
lib.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
loader_builders.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
loader.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
meta.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
path.rs Switch bevy_asset to core::prelude (#17442) 2025-01-20 04:14:48 +00:00
reflect.rs Harden proc macro path resolution and add integration tests. (#17330) 2025-02-09 19:45:45 +00:00
render_asset.rs Split off bevy_image from bevy_render (#15650) 2024-10-04 20:16:47 +00:00
saver.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
transformer.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00