Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vectors of dynamic assets in dynamic asset files #151

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

NiklasEi
Copy link
Owner

@NiklasEi NiklasEi commented Sep 10, 2023

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 Upcoming v0.9 release ron-rs/ron#496
  • Simplify/double-check trait bounds
  • 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?
    • Check if bevy_asset doesn't already require serde (Yes, it does)

Resolves #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array syntax in RON dynamic collections?
1 participant