bevy_asset_loader icon indicating copy to clipboard operation
bevy_asset_loader copied to clipboard

Support vectors of dynamic assets in dynamic asset files

Open NiklasEi opened this issue 9 months ago • 0 comments

This allows for dynamic asset files like

({
    "files": [
        File(path: "images/tree.png"),
        File(path: "images/player.png"),
    ],
})

and even works for custom dynamic assets and nested collections

({
    "images": [
        CombinedImage (
            bottom_layer: "images/tree.png",
            top_layer: "images/player.png",
        ),
        [
            File(path: "images/tree.png"),
            File(path: "images/player.png"),
        ],
        Folder(path: "images")
    ],
})

ToDo

  • [ ] Update bevy_common_assets when the new ron version is published ron-rs/ron#496
  • [ ] Simplify/double-check trait bounds
  • [x] Remove StandardDynamicAsset::Files in preference of defining vecs in the asset files?
  • [ ] Make OneOrManyDynamicAssets optional
    • [ ] Maybe move the asset wrapper type to a trait as an associated type?
    • [ ] Write a test to ensure users can add custom dynamic assets without it
  • [ ] ~Introduce a new feature for dynamic assets to hide serde behind it?~
    • [x] Check if bevy_asset doesn't already require serde (Yes, it does)

Resolves #78

NiklasEi avatar Sep 10 '23 19:09 NiklasEi