-
Notifications
You must be signed in to change notification settings - Fork 56
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
Any Way to support nested define GameAssets structure? #246
Comments
Could you give an example of what you want your asset collection to look like? |
In my earliest game development, I only considered one type of player assets. However, after wanting to add more player assets into my game, if I continue adding other player assets into the same #[derive(AssetCollection, Resource)]
pub struct GameAssets {
// -- PLAYER ---
#[asset(texture_atlas(
tile_size_x = 80,
tile_size_y = 80,
columns = 23,
rows = 5
))]
pub player_layout: Handle<TextureAtlasLayout>,
#[asset(path = "player/player.png")]
pub player_sprite: Handle<Image>,
#[asset(
paths(
"player/player.trickfilm#idle",
"player/player.trickfilm#moving",
"player/player.trickfilm#dashing",
"player/player.trickfilm#hooking",
"player/player.trickfilm#sliding",
),
collection(typed)
)]
pub player_animations: Vec<Handle<AnimationClip2D>>,
#[asset(texture_atlas(
tile_size_x = 192,
tile_size_y = 192,
columns = 10,
rows = 23,
))]
pub player02_layout: Handle<TextureAtlasLayout>,
#[asset(path = "player/player02.png")]
pub player02_sprite: Handle<Image>,
#[asset(
paths(
"player/player02.trickfilm#heal",
"player/player02.trickfilm#defence",
"player/player02.trickfilm#flames",
"player/player02.trickfilm#buff",
),
collection(typed)
)]
pub player02_animations: Vec<Handle<AnimationClip2D>>, Can I put some related resource content into a structure, and then use fields to store it in |
There is no support for nested asset collections at the moment. In this case, I would prefer to split your collection by "domain". Why not create an |
now i put all assets hanndlers in a struct
GameAssets
, can i split to the corresponding module's assets mod?The text was updated successfully, but these errors were encountered: