Closed Jessie8Bit closed 5 months ago
Hello,
I would like to use an custom key for an mapped asset collection. Would it be possible to implement something like this:
#[derive(AssetCollection, Resource)] pub struct ObjectCollection { #[asset(path = "meshes/objects", collection(typed, mapped))] pub meshes: HashMap<AssetId, Handle<Mesh>>, } pub struct AssetId(String); impl From<String> for AssetId { fn from(name: String) -> Self { Self(Path::new(name.as_str()).with_extension("").file_name().unwrap().to_str().unwrap().to_owned()) } }
Hello,
I would like to use an custom key for an mapped asset collection. Would it be possible to implement something like this: