Skip to content

Commit 30e4948

Browse files
authored
Merge pull request #386 from stride3d/master
Deploy latest documentation updates to staging
2 parents e1b278e + 2948245 commit 30e4948

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

en/manual/scripts/best-practice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This will set some expectation as to where the system you're building should res
2525

2626
Some entry and exit points to manage your systems' lifetime:
2727
- On demand by getting and setting it in the Services
28-
- System as a [singleton script](#Statics-singletons-and-other-global-like-writes) with the `Start()` and `Cancel()`
28+
- System as a [singleton script](#statics-singletons-and-other-globals) with the `Start()` and `Cancel()`
2929
- Through your game's `BeginRun()` and `EndRun()`
3030
- As a component processor when associated component types are added to the scene
3131

@@ -246,4 +246,4 @@ One thing you may also consider is whether to simply merge the dependant object
246246

247247
* [Scheduling and priorities](scheduling-and-priorities.md)
248248
* [Flexible processors](../engine/entity-component-system/flexible-processing.md)
249-
* [Custom Assets](custom-assets.md)
249+
* [Custom Assets](custom-assets.md)

en/manual/scripts/custom-assets.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Here's how it looks like in a default game project:
2323
</ItemGroup>
2424
</Project>
2525
```
26-
>[!Warning]
26+
> [!Warning]
2727
> Make sure that the version specified for `Stride.Core.Assets` matches the other package's versions.
2828
2929
Inside the same project, create a new csharp file and replace its content with the following:
@@ -82,8 +82,12 @@ public sealed class YOUR_CLASS_COMPILER : AssetCompilerBase
8282

8383
public override IEnumerable<ObjectUrl> GetInputFiles(AssetItem assetItem)
8484
{
85-
// Yield asset items you are dependent on to include them in the build
86-
85+
// Yield assets that must be built before this one is built,
86+
// this is for cases were you need to read from a compiled version of an asset to build this one.
87+
// Note that creating cyclic references through this method will cause a deadlock when building
88+
// (e.g.: A is input of B while B is input of A)
89+
90+
// below only for reference purposes, useless in this context
8791
var asset = (YOUR_CLASS_ASSET)assetItem.Asset;
8892
foreach (var block in asset.PrefabCollection)
8993
{
@@ -116,6 +120,10 @@ public sealed class YOUR_CLASS_COMPILER : AssetCompilerBase
116120
}
117121
}
118122
```
123+
124+
> [!Warning]
125+
> 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.
126+
119127
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 ...
120128

121129
## Adding a section for the Add asset menu inside the editor

0 commit comments

Comments
 (0)