From effc8ca2d6352c577008fa0aa7bb38131b592106 Mon Sep 17 00:00:00 2001 From: Zac Harrold Date: Mon, 9 Sep 2024 07:54:33 +1000 Subject: [PATCH] Updated `LoadTransformAndSave` Documentation Explicitly linking to `IdentityAssetTransformer` and explaining under what circumstances you may wish to use it. --- crates/bevy_asset/src/processor/process.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/bevy_asset/src/processor/process.rs b/crates/bevy_asset/src/processor/process.rs index 1f30b8f11e97e..92a13f21ff44e 100644 --- a/crates/bevy_asset/src/processor/process.rs +++ b/crates/bevy_asset/src/processor/process.rs @@ -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