Loading scene assets #23888
|
At the current state of Bevy, what is the recommended approach to load the assets that are required by a particular scene? I don't want to load all the sprites used in a game, for example. I'd rather load a scene and then only load those that are required by it. I saw some discussions that seem to touch on this subject, but I haven't been able to find an example of how it's currently done. I also don't want to hardcode a type for each kind of "thing" in my game either, I want to say "here's an entity, here are its components, and it should have a Sprite component with this path." There's also this example in Thanks in advance! |
Replies: 1 comment 3 replies
|
The current best pattern is |
You're right, and apologies — the macro-hardcoded-keys thing is a real limitation of
DynamicAssetCollectionas written, so my answer oversold it. The manual path (bypassing the macro and using the rawDynamicAssetsAPI to load/drop per scene) is the only way to really drive it from a manifest today. I haven't shipped this exact pattern, so treat the suggestion as "direction worth trying" rather than "known-good recipe." Bevy's asset loader story is still evolving here.