Browse Source

Clarify usage of input files for custom-assets.md

Eideren 1 year ago
parent
commit
69dbaab036
1 changed files with 11 additions and 3 deletions
  1. 11 3
      en/manual/scripts/custom-assets.md

+ 11 - 3
en/manual/scripts/custom-assets.md

@@ -82,8 +82,12 @@ public sealed class YOUR_CLASS_COMPILER : AssetCompilerBase
 
     public override IEnumerable<ObjectUrl> GetInputFiles(AssetItem assetItem)
     {
-        // Yield asset items you are dependent on to include them in the build 
-        
+        // Yield assets that must be built before this one is built,
+	// this is for cases were you need to read from a compiled version of an asset to build this one.
+	// Note that creating cyclic references through this method will cause a deadlock when building
+	// (e.g.: A is input of B while B is input of A)
+
+	// below only for reference purposes, useless in this context
         var asset = (YOUR_CLASS_ASSET)assetItem.Asset;
         foreach (var block in asset.PrefabCollection)
         {
@@ -116,6 +120,10 @@ public sealed class YOUR_CLASS_COMPILER : AssetCompilerBase
     }
 }
 ```
+
+>[!Warning]
+> Every changes made to the runtime asset will break previously built asset databases, make sure to delete the build artifacts stride generates for assets (`YOUR_PROJECT.Windows/obj/stride` and `bin/db`) after changing the class to make sure the asset database is fully rebuilt on the next build.
+
 This takes care of the support for this asset, you could create a `*.blks` file inside your `Assets` directory and fill in the content manually, but might as well do it through the editor ...
 
 ## Adding a section for the Add asset menu inside the editor
@@ -176,4 +184,4 @@ RootAssets: []
 
 And you're finally done, have fun !
 
-![Result](media/template-result.png)
+![Result](media/template-result.png)