Skip to content

Commit

Permalink
Updated LoadTransformAndSave Documentation
Browse files Browse the repository at this point in the history
Explicitly linking to `IdentityAssetTransformer` and explaining under what circumstances you may wish to use it.
  • Loading branch information
bushrat011899 committed Sep 8, 2024
1 parent 232abbc commit effc8ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bevy_asset/src/processor/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ pub trait Process: Send + Sync + Sized + 'static {
/// an [`AssetSaver`] that allows you save any `S` asset. However you can
/// also implement [`Process`] directly if [`LoadTransformAndSave`] feels limiting or unnecessary.
///
/// If your [`Process`] does not need to transform the [`Asset`], you can use [`IdentityAssetTransformer`] as `T`.
/// This will directly return the input [`Asset`], allowing your [`Process`] to directly load and then save an [`Asset`].
/// However, this pattern should only be used for cases such as file format conversion.
/// Otherwise, consider refactoring your [`AssetLoader`] and [`AssetSaver`] to isolate the transformation step into an explicit [`AssetTransformer`].
///
/// This uses [`LoadTransformAndSaveSettings`] to configure the processor.
///
/// [`Asset`]: crate::Asset
Expand Down

0 comments on commit effc8ca

Please sign in to comment.