From b1f353471eca898542fc60e5fe1f81bed38d32dd Mon Sep 17 00:00:00 2001 From: Glory2Antares <143124732+Glory2Antares@users.noreply.github.com> Date: Sat, 30 Aug 2025 16:23:16 -0700 Subject: [PATCH 1/2] Impl VisitAssetDependencies for Arrays --- crates/bevy_asset/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index c36f5667361b4..d4b02a2831d02 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -485,6 +485,22 @@ impl VisitAssetDependencies for Option { } } +impl VisitAssetDependencies for [Handle; N] { + fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId)) { + for dependency in self { + visit(dependency.id().untyped()); + } + } +} + +impl VisitAssetDependencies for [UntypedHandle; N] { + fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId)) { + for dependency in self { + visit(dependency.id()); + } + } +} + impl VisitAssetDependencies for Vec> { fn visit_dependencies(&self, visit: &mut impl FnMut(UntypedAssetId)) { for dependency in self { From 89b94bcf5ab1aba8c002d2852f6afa83590c848f Mon Sep 17 00:00:00 2001 From: Glory2Antares <143124732+Glory2Antares@users.noreply.github.com> Date: Sat, 30 Aug 2025 17:02:17 -0700 Subject: [PATCH 2/2] Add tests --- crates/bevy_asset/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_asset/src/lib.rs b/crates/bevy_asset/src/lib.rs index d4b02a2831d02..81de17e1eea3a 100644 --- a/crates/bevy_asset/src/lib.rs +++ b/crates/bevy_asset/src/lib.rs @@ -693,6 +693,7 @@ mod tests { loader::{AssetLoader, LoadContext}, Asset, AssetApp, AssetEvent, AssetId, AssetLoadError, AssetLoadFailedEvent, AssetPath, AssetPlugin, AssetServer, Assets, InvalidGenerationError, LoadState, UnapprovedPathMode, + UntypedHandle, }; use alloc::{ boxed::Box, @@ -1908,6 +1909,10 @@ mod tests { handle: Handle, #[dependency] embedded: TestAsset, + #[dependency] + array_handles: [Handle; 5], + #[dependency] + untyped_array_handles: [UntypedHandle; 5], } #[expect(