bevy/examples/asset
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
..
files Fix asset_settings example regression (#15945) 2024-10-16 14:16:23 +00:00
processing Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
alter_mesh.rs simplify example, replace get_single to Single Query (#16187) 2024-11-01 18:25:42 +00:00
alter_sprite.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
asset_decompression.rs Remove labeled_assets from LoadedAsset and ErasedLoadedAsset (#15481) 2025-02-10 21:06:37 +00:00
asset_loading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
asset_settings.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
custom_asset_reader.rs Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
custom_asset.rs Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
embedded_asset.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
extra_source.rs Migrate bevy_sprite to required components (#15489) 2024-10-09 16:17:26 +00:00
hot_asset_reloading.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
multi_asset_sync.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
repeated_texture.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00