Trait bevy::asset::transformer::AssetTransformer
source · pub trait AssetTransformer: Send + Sync + 'static {
type AssetInput: Asset;
type AssetOutput: Asset;
type Settings: Settings + Default + Serialize + for<'a> Deserialize<'a>;
type Error: Into<Box<dyn Error + Send + Sync>>;
// Required method
fn transform<'a>(
&'a self,
asset: TransformedAsset<Self::AssetInput>,
settings: &'a Self::Settings
) -> Pin<Box<dyn Future<Output = Result<TransformedAsset<Self::AssetOutput>, Self::Error>> + Send + 'a>>;
}
Expand description
Transforms an Asset
of a given AssetTransformer::AssetInput
type to an Asset
of AssetTransformer::AssetOutput
type.
Required Associated Types§
sourcetype AssetInput: Asset
type AssetInput: Asset
The Asset
type which this AssetTransformer
takes as and input.
sourcetype AssetOutput: Asset
type AssetOutput: Asset
The Asset
type which this AssetTransformer
outputs.
sourcetype Settings: Settings + Default + Serialize + for<'a> Deserialize<'a>
type Settings: Settings + Default + Serialize + for<'a> Deserialize<'a>
The settings type used by this AssetTransformer
.
Required Methods§
sourcefn transform<'a>(
&'a self,
asset: TransformedAsset<Self::AssetInput>,
settings: &'a Self::Settings
) -> Pin<Box<dyn Future<Output = Result<TransformedAsset<Self::AssetOutput>, Self::Error>> + Send + 'a>>
fn transform<'a>( &'a self, asset: TransformedAsset<Self::AssetInput>, settings: &'a Self::Settings ) -> Pin<Box<dyn Future<Output = Result<TransformedAsset<Self::AssetOutput>, Self::Error>> + Send + 'a>>
Transformes the given TransformedAsset
to AssetTransformer::AssetOutput
.
The TransformedAsset
’s labeled_assets
can be altered to add new Labeled Sub-Assets
The passed in settings
can influence how the asset
is transformed