Trait amethyst_assets::Asset
source · pub trait Asset: Send + Sync + 'static {
type Data: Send + Sync + 'static;
type HandleStorage: UnprotectedStorage<Handle<Self>> + Send + Sync;
const NAME: &'static str;
}
Expand description
One of the three core traits of this crate.
You want to implement this for every type of asset like
Mesh
Texture
Terrain
and so on. Now, an asset may be available in different formats.
That’s why we have the Data
associated type here. You can specify
an intermediate format here, like the vertex data for a mesh or the samples
for audio data.
This data is then generated by the Format
trait.
Required Associated Types
sourcetype HandleStorage: UnprotectedStorage<Handle<Self>> + Send + Sync
type HandleStorage: UnprotectedStorage<Handle<Self>> + Send + Sync
The ECS storage type to be used. You’ll want to use VecStorage
in most cases.