diff --git a/en/includes/asset-status-dots.md b/en/includes/asset-status-dots.md new file mode 100644 index 000000000..d794b52b9 --- /dev/null +++ b/en/includes/asset-status-dots.md @@ -0,0 +1,9 @@ +In the **Asset view**, you can see a dot in the top left corner of every asset that signifies how it will be compiled. + +![](media/asset-view-indicators.webp) + +Each color represents something: + +* 🔵 **Blue** (will be compiled) - this asset is marked as root, meaning that it will always be compiled in the game no matter if it's referenced or not. +* 🟢 **Green** (will be compiled) - this asset is referenced by another asset that is used in the game, meaning that it will be compiled. +* ⚫ **Gray** (won't be compiled) - this asset isn't referenced by any other asset that's used in the game, meaning that it won't be compiled. diff --git a/en/includes/content-loading-warning.md b/en/includes/content-loading-warning.md new file mode 100644 index 000000000..80fb8e541 --- /dev/null +++ b/en/includes/content-loading-warning.md @@ -0,0 +1,2 @@ +> [!WARNING] +> When assets are loaded manually, **they have to be manually unloaded too**, or else Stride will keep the assets **loaded in memory forever**. diff --git a/en/manual/get-started/media/asset-view-indicators.webp b/en/includes/media/asset-view-indicators.webp similarity index 100% rename from en/manual/get-started/media/asset-view-indicators.webp rename to en/includes/media/asset-view-indicators.webp diff --git a/en/manual/animation/index.md b/en/manual/animation/index.md index 9a16546e6..0e07c6dcc 100644 --- a/en/manual/animation/index.md +++ b/en/manual/animation/index.md @@ -28,7 +28,7 @@ Skeletons don't have to resemble the skeletons of real humans or animals. You ca **Skinned models** are models that have been skinned to match a skeleton. The **skin** describes how vertices of the mesh transform when bones move. >[!NOTE] ->In Game Studio, you can only create simple 3D models such as spheres and cubes. For information about how to do this, see [Create assets](../game-studio/create-assets.md). To create more complex models, use dedicated software like 3DS Max, Maya, or Blender, then [import the model into Game Studio](import-animations.md). +>In Game Studio, you can only create simple 3D models such as spheres and cubes. For information about how to do this, see [Create an asset](../assets/create-an-asset.md). To create more complex models, use dedicated software like 3DS Max, Maya, or Blender, then [import the model into Game Studio](import-animations.md). ## Animation clips @@ -53,4 +53,4 @@ The templates **First-person shooter**, **Third-person platformer** and **Top-do * [Procedural animation](procedural-animation.md) * [Custom blend trees](custom-blend-trees.md) * [Model node links](model-node-links.md) -* [Custom attributes](custom-attributes.md) \ No newline at end of file +* [Custom attributes](custom-attributes.md) diff --git a/en/manual/assets/archetypes.md b/en/manual/assets/archetypes.md new file mode 100644 index 000000000..0ca1a42c9 --- /dev/null +++ b/en/manual/assets/archetypes.md @@ -0,0 +1,44 @@ +# Archetypes + +Intermediate + +Stride allows you to create variants of the same asset that only change a selected number of properties, while remaining synchronized with the base. + +![](media/archetypes.webp) + +Here is some terminology to keep in mind: + +* **Archetype** - the original asset. +* **Derived asset** - an asset that derives from an archetype. + +## Creating a derived asset + +In the **Asset view**, right click on the asset you want to derive from and select **Create derived asset**. + +![](media/asset-view-create-derived.webp) + +**Game Studio** then creates a new derived asset which you can modify. + +## Overriding values + +When changing a property of a derived asset in the **Property grid**, it will be marked as overridden. Overridden properties are slightly brighter and bolder. + +![](media/property-grid-overriden-property.webp) + +Overridden properties will not be updated when they are changed on the archetype. + +## Reverting overrides + +In case you want to revert a property override to use the same values as the archetype, right click on it in the **Property grid** and select **Reset to base value**. + +## Unlink from archetype + +If you want to turn a derived asset into a normal one (unlinking it from the archetype), in the **Asset view** right click on it and select **Clear archetype**. + +![](media/property-grid-reset-to-base.webp) + +Now, the asset will no longer follow changes done to the archetype. + +## See also + +* [Create an asset](create-an-asset.md) diff --git a/en/manual/assets/asset-bundles.md b/en/manual/assets/asset-bundles.md new file mode 100644 index 000000000..809ab3dff --- /dev/null +++ b/en/manual/assets/asset-bundles.md @@ -0,0 +1,98 @@ +# Asset bundles + +Advanced +Programmer + +After compilation, assets are turned into **asset bundles**. By default, only one asset bundle is created, but this can be changed in order to, for example: separate DLC content into it's own bundle, so that it could be sold separately. + +When the game starts, Stride only loads the `default` bundle. Other bundles need to be loaded manually through code. + +## Create an asset bundle + +> [!NOTE] +> Currently, this has to be done manually. + +In order to create new asset bundles, you'll have to modify the `.sdpkg` file of a project package. For more information about project package properties visit [this page](../files-and-folders/project-packages/package-properties.md). + +Bundles are defined under the `Bundle` property. Each bundle has a `Name`, a list of `Dependencies` on other bundles and a list of `Selectors` that specify which assets belong to the bundle. + +There are 2 types of selectors: +* 🏷️ **Tag selector** - selects assets that have at least one of the specified `Tags`. +* 📁 **Path selector** - selects assets based on the provided list of `Paths`. Filters work similarly to the [`.gitignore` filtering convention](https://git-scm.com/docs/gitignore#_pattern_format) with a few exceptions: `!` (negations), `[]` (groups) and `#` (comments). This means that you can select **individual files**, **entire folders** or **files with a specific extension**. + +Here's an example configuration: + +```yaml +Bundles: + - Name: CustomBundleA + Selectors: + - !TagSelector + Tags: + - MyTag1 + - MyTag2 + - Name: CustomBundleB + Dependencies: + - CustomBundleA + Selectors: + - !TagSelector + Tags: + - MyTag3 + - MyTag4 + - !PathSelector + Paths: + - folder1/ + - /folder2/ + - *.sdtex + - folder3/*.sdscene +``` + +> [!CAUTION] +> If any of your custom bundles are **empty**, Stride will **fail to build** the game. + +### Root assets + +It's important to note that assets from optional bundles (such as DLC content) **shouldn't be referenced by assets from the default bundle**. If the other bundle is missing, Stride will fail when trying to load it's assets. + +However, if a bundle's assets are unreferenced, Stride will not compile them. To prevent this, make sure to **mark the appropriate assets (such as scenes) as root**. The assets will then be accessible in code. + +For more information about root assets, visit [Asset compilation](asset-compilation.md). + +### Compiling behaviour + +Stride tries to place assets in the most appropriate bundle. + +1. Assets not defined in `Bundles` are placed in the **default** bundle, which is loaded automatically when the game starts. +2. If an asset is selected by **BundleA** and **BundleB**, but **BundleB** has a dependency on **BundleA**, that asset is placed only in **BundleA**. +3. If an asset is selected by **BundleA** and **BundleB** and both of them aren't dependent on each other, that asset is placed in both of them. + +> [!NOTE] +> Loading two bundles with the same asset won't result in a duplicate. + +## Loading bundles + +Stride **automatically loads the default bundle**. However, other bundles need to be manually loaded through code using [`LoadBundle`](xref:Stride.Core.Storage.ObjectDatabase.LoadBundle*). + +```csharp +await Content.FileProvider.ObjectDatabase.LoadBundle("NameOfBundle"); +``` + +> [!NOTE] +> When loading a bundle, it's dependencies are loaded automatically. + +Assets can then be loaded via the **content system**. For more information, visit the [use an asset in code page](use-an-asset-in-code.md). + +## Bundle location + +Bundles are located in `data/db/bundles` next to the built executable. You can recognize them by their name. + +For more information about the build location, visit the [build file structure page](../files-and-folders/building-the-game/build-file-structure.md). + +![](media/asset-bundle-location.webp) + +> [!NOTE] +> Bundles tend to be split into multiple files that start with the same name. + +## See also + +* [Asset compilation](asset-compilation.md) +* [Use an asset in code](use-an-asset-in-code.md) diff --git a/en/manual/assets/asset-compilation.md b/en/manual/assets/asset-compilation.md new file mode 100644 index 000000000..4373e827f --- /dev/null +++ b/en/manual/assets/asset-compilation.md @@ -0,0 +1,62 @@ +# Asset compilation + +Beginner + +Assets are compiled into **bundles**. + +## Which assets are compiled + +Stride only compiles assets which are used in the game. This means that if an asset isn't referenced by another asset that is determined as needed, it will be ignored. + +TODO: VISUALIZATION + +## Blue, green and gray dots + +[!INCLUDE [asset-status-dots](../../includes/asset-status-dots.md)] + +## Root assets + +🔵 **Root assets** are assets that will always be compiled, no matter if they are referenced or not. + +A few remarks: + +* Root assets can be defined in a [project package](../files-and-folders/project-packages/index.md) to which they belong or any other [project package](../files-and-folders/project-packages/index.md) that uses it as a [dependency](../files-and-folders/project-packages/dependencies.md). +* You can only mark individual assets as root, not folders. + +### How to mark an asset as root + +You can mark an asset as root by right clicking on it in the **Asset view** and selecting **🔵 Include in build as root asset**. + +![](media/asset-view-include-root.webp) + +> [!WARNING] +> Marking an asset as root in **Game Studio** will only mark it **for the selected platform**. Make sure to either: +> * Mark the asset as root for every platform your project targets +> * Edit the main [project package](../files-and-folders/project-packages/index.md)'s `.sdpkg` file manually. For more information, visit the [package properties page](../files-and-folders/project-packages/package-properties.md). + +## Checking assets + +You can use [`Content.FileProvider.ContentIndexMap`](xref:Stride.Core.Serialization.Contents.IContentIndexMap) to check what assets are available. + +```csharp +if (Content.FileProvider.ContentIndexMap.Contains("Models/Enemy")) +{ + // Execute code if the asset exists +} + +var allContent = Content.FileProvider.ContentIndexMap.GetMergedIdMap() + .Select(x => x.Key); +``` + +> [!NOTE] +> The content system also contains shaders and shader information. If you want to use [`GetMergedIdMap`](xref:Stride.Core.Serialization.Contents.IContentIndexMap.GetMergedIdMap) to check which assets are loaded, consider filtering out paths that start with `shaders/` and `__shaders_bytecode__/`. +> +> ```csharp +> var allAssets = Content.FileProvider.ContentIndexMap.GetMergedIdMap() +> .Select(x => x.Key) +> .Where(x => !x.StartsWith("shaders/") && !x.StartsWith("__shaders_bytecode__/")); +> ``` + +## See also + +* [Use an asset in code](use-an-asset-in-code.md) diff --git a/en/manual/assets/create-an-asset.md b/en/manual/assets/create-an-asset.md new file mode 100644 index 000000000..c4482585e --- /dev/null +++ b/en/manual/assets/create-an-asset.md @@ -0,0 +1,30 @@ +# Create an asset + +Beginner + +Assets can be created with **Game Studio** in the **Asset view**. + +## Create an asset + +To create an asset, click the **➕ Add assets** button in the **Asset view** and select the type of asset you want to create. + +![](media/asset-view-create-new.webp) + +## Create an asset from resource + +To create an asset from a resource, simply drag and drop it into the **Asset view** and select the type of asset you want to create. + +![](media/asset-view-from-resource-type.webp) + +If the resource isn't present in the resources folder, **Game Studio** will ask you if you want to move it there. In the majority of cases, **you will want to click yes**. + +![](media/asset-view-copy-resource.webp) + +Finally, you will be asked if you want to **move it to the default location**. Again, most of the time **you will want to do this**, unless you need more control over where resources end up. + +![](media/asset-view-resource-default-location.webp) + +## See also +* [Edit an asset](edit-an-asset.md) +* [Use an asset](use-an-asset.md) +* [Use an asset in code](use-an-asset-in-code.md) diff --git a/en/manual/assets/edit-an-asset.md b/en/manual/assets/edit-an-asset.md new file mode 100644 index 000000000..f444d4f80 --- /dev/null +++ b/en/manual/assets/edit-an-asset.md @@ -0,0 +1,41 @@ +# Edit an asset + +Beginner + +Most assets are just a simple list of properties, which can be edited in the **Property grid**. However, more complex assets (such as scenes) require the use of a **dedicated editor**. + +## Editing in Property grid + +When you select an asset in the **Asset view**, it's properties will show up in the **Property grid**. + +![](media/property-grid-asset-properties.webp) + +Your changes will be reflected in the **Asset preview** in real time. + +![](media/asset-preview.webp) + +> [!NOTE] +> Modified assets aren't automatically saved. You will have to save them manually by going to **File > Save** or by pressing **Ctrl + S**. + +## Editing using a dedicated editor + +Certain assets require the use of a dedicated editor. The most notable example of this are **Scenes**. + +Currently, the assets that have a dedicated editor are: + +* Graphics compositor +* Prefabs +* Scenes +* Sprite sheets +* Ui pages +* Ui libraries +* Scripts + +To open a dedicated editor for an asset either **double click it**, right click and select **🖉 Edit asset** or select it and press **Ctrl + Enter**. + +![](media/asset-view-edit-asset.webp) + +# See also + +* [Use an asset](use-an-asset.md) +* [Use an asset in code](use-an-asset-in-code.md) diff --git a/en/manual/assets/index.md b/en/manual/assets/index.md new file mode 100644 index 000000000..abe597198 --- /dev/null +++ b/en/manual/assets/index.md @@ -0,0 +1,42 @@ +# Assets + +Beginner + +**Assets** are representations of elements in a project (such as scenes, textures or audio), which can be used by scripts or other assets. An example would be the **model component** using a **model asset**. + +**Resources** on the other hand are the files containing actual data (such as images or music), which can be used by assets. + +In short: +* **Resources** - raw data files (`.png`, `.wav`, `.fbx`) +* **Assets** - usable elements in the game. They can use resource files and contain additional properties. + +## Blue, green and gray dots + +Stride only compiles assets which are used in the game. This means that if an asset isn't referenced by another asset that is determined as needed, it will be ignored. + +TODO: VISUALIZATION + +[!INCLUDE [asset-status-dots](../../includes/asset-status-dots.md)] + +For more information about how assets are compiled, visit [Asset compilation](asset-compilation.md) + +## Location of assets and resources + +In **Game Studio** you can view assets in the **Asset view** by selecting an **assets** folder in the **solution explorer**. + +![](media/solution-explorer-assets.webp) + +As for **resources**, it isn't possible to view them in **Game Studio**. You can browse through them by opening the directory containing your project and going to a resource folder of the target [project package](../files-and-folders/project-packages/index.md). + +For more information, visit [Project file structure](../files-and-folders/project-structure.md). + +## In this section + +* [Create an asset](create-an-asset.md) +* [Edit an asset](edit-an-asset.md) +* [Use an asset](use-an-asset.md) +* [Use an asset in code](use-an-asset-in-code.md) +* [Tags](tags.md) +* [Archetypes](archetypes.md) +* [Asset compilation](asset-compilation.md) +* [Asset bundles](asset-bundles.md) diff --git a/en/manual/assets/media/archetypes.svg b/en/manual/assets/media/archetypes.svg new file mode 100644 index 000000000..863fa2e1b --- /dev/null +++ b/en/manual/assets/media/archetypes.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a98f696ee1cb85a40979a48fea10d9f3d6d69dd463f470c72b45dad5f32570c +size 28417 diff --git a/en/manual/assets/media/archetypes.webp b/en/manual/assets/media/archetypes.webp new file mode 100644 index 000000000..164ef0d0b --- /dev/null +++ b/en/manual/assets/media/archetypes.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c864c981d09f527421f2b01f312e8ee9664c24787dde0252fc0708f552d85f3 +size 106804 diff --git a/en/manual/assets/media/asset-bundle-location.svg b/en/manual/assets/media/asset-bundle-location.svg new file mode 100644 index 000000000..398b1207a --- /dev/null +++ b/en/manual/assets/media/asset-bundle-location.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b5da04a6f4cc428f748a778c02549dcc72d2b53472cbdcec5c44a2291dcbf8c7 +size 106726 diff --git a/en/manual/assets/media/asset-bundle-location.webp b/en/manual/assets/media/asset-bundle-location.webp new file mode 100644 index 000000000..902cddd4a --- /dev/null +++ b/en/manual/assets/media/asset-bundle-location.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb4cbce3b67bef9adc54242415b9eb6bd382e58e5b97154df17c8450c540ef3f +size 194236 diff --git a/en/manual/assets/media/asset-preview.webp b/en/manual/assets/media/asset-preview.webp new file mode 100644 index 000000000..c17cef6d4 --- /dev/null +++ b/en/manual/assets/media/asset-preview.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd00458a1ab0a4990ba74eb5783d1d07c0f8bd53e15c3568b4ce2b758ff8098c +size 7742 diff --git a/en/manual/get-started/media/asset-view-copy-resource.webp b/en/manual/assets/media/asset-view-copy-resource.webp similarity index 100% rename from en/manual/get-started/media/asset-view-copy-resource.webp rename to en/manual/assets/media/asset-view-copy-resource.webp diff --git a/en/manual/assets/media/asset-view-create-derived.webp b/en/manual/assets/media/asset-view-create-derived.webp new file mode 100644 index 000000000..42bfa96fd --- /dev/null +++ b/en/manual/assets/media/asset-view-create-derived.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc7434fbcfdf09fdf56655c1ee7755592408dce554f6d699abb029a21e0d8ecd +size 42724 diff --git a/en/manual/get-started/media/asset-view-create-new.webp b/en/manual/assets/media/asset-view-create-new.webp similarity index 100% rename from en/manual/get-started/media/asset-view-create-new.webp rename to en/manual/assets/media/asset-view-create-new.webp diff --git a/en/manual/assets/media/asset-view-edit-asset.webp b/en/manual/assets/media/asset-view-edit-asset.webp new file mode 100644 index 000000000..9ee982569 --- /dev/null +++ b/en/manual/assets/media/asset-view-edit-asset.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:704c5e86bda8a01fe5e53f99739b823de618236f56f21b85108b6e8e085192d4 +size 10810 diff --git a/en/manual/get-started/media/asset-view-from-resource-type.webp b/en/manual/assets/media/asset-view-from-resource-type.webp similarity index 100% rename from en/manual/get-started/media/asset-view-from-resource-type.webp rename to en/manual/assets/media/asset-view-from-resource-type.webp diff --git a/en/manual/get-started/media/asset-view-include-root.webp b/en/manual/assets/media/asset-view-include-root.webp similarity index 100% rename from en/manual/get-started/media/asset-view-include-root.webp rename to en/manual/assets/media/asset-view-include-root.webp diff --git a/en/manual/get-started/media/asset-view-resource-default-location.webp b/en/manual/assets/media/asset-view-resource-default-location.webp similarity index 100% rename from en/manual/get-started/media/asset-view-resource-default-location.webp rename to en/manual/assets/media/asset-view-resource-default-location.webp diff --git a/en/manual/assets/media/property-grid-asset-properties.webp b/en/manual/assets/media/property-grid-asset-properties.webp new file mode 100644 index 000000000..0c2b963ca --- /dev/null +++ b/en/manual/assets/media/property-grid-asset-properties.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0008ed3bde31767b3081af578a21072914193287da19e0500a7ba6de8101e351 +size 51624 diff --git a/en/manual/assets/media/property-grid-asset-reference-drag-and-drop.webp b/en/manual/assets/media/property-grid-asset-reference-drag-and-drop.webp new file mode 100644 index 000000000..841d620b1 --- /dev/null +++ b/en/manual/assets/media/property-grid-asset-reference-drag-and-drop.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ca1a45d39b7c4499c928c4709ca2876ec874f9d9910cc1cf4ab3beaac2898ab +size 5364 diff --git a/en/manual/assets/media/property-grid-asset-reference.webp b/en/manual/assets/media/property-grid-asset-reference.webp new file mode 100644 index 000000000..486b40fb6 --- /dev/null +++ b/en/manual/assets/media/property-grid-asset-reference.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:824d00468991e083c09d59102c75a16d52f3df7c270d8c96a9b215fd3b3512f5 +size 2992 diff --git a/en/manual/assets/media/property-grid-direct-reference-example.webp b/en/manual/assets/media/property-grid-direct-reference-example.webp new file mode 100644 index 000000000..991756f5b --- /dev/null +++ b/en/manual/assets/media/property-grid-direct-reference-example.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9baadc5dcc17602c81b6dd068337b00a3ca06529bbbd6d84b5c59af8cbb5c221 +size 6028 diff --git a/en/manual/assets/media/property-grid-overriden-property.webp b/en/manual/assets/media/property-grid-overriden-property.webp new file mode 100644 index 000000000..6517c6a36 --- /dev/null +++ b/en/manual/assets/media/property-grid-overriden-property.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6b99f979ba85eebc1133d653f090864f6df3b288e5146e2cf899994a7409a43 +size 7782 diff --git a/en/manual/assets/media/property-grid-reset-to-base.webp b/en/manual/assets/media/property-grid-reset-to-base.webp new file mode 100644 index 000000000..140bb8024 --- /dev/null +++ b/en/manual/assets/media/property-grid-reset-to-base.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d94dc7dc654b3f37feaeb7730ebf69e77044054b909df82e12aece390c720523 +size 12240 diff --git a/en/manual/assets/media/property-grid-tags.webp b/en/manual/assets/media/property-grid-tags.webp new file mode 100644 index 000000000..e284a3612 --- /dev/null +++ b/en/manual/assets/media/property-grid-tags.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f600de6536e248125d4ead02c3fe0de41ce00c2f787f11d0304c92030f3c9fca +size 6310 diff --git a/en/manual/assets/media/property-grid-url-reference-example.webp b/en/manual/assets/media/property-grid-url-reference-example.webp new file mode 100644 index 000000000..e6e341fec --- /dev/null +++ b/en/manual/assets/media/property-grid-url-reference-example.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6433dc9e92f399407896ef83d8053052ca5d2cc36398e4b9b5141d6b35d9ed92 +size 6558 diff --git a/en/manual/assets/media/solution-explorer-assets.webp b/en/manual/assets/media/solution-explorer-assets.webp new file mode 100644 index 000000000..23dd8ee84 --- /dev/null +++ b/en/manual/assets/media/solution-explorer-assets.webp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2116a144a5f7eee6e8207c889143a2542073aecf5f35d902edc55a6054429295 +size 11730 diff --git a/en/manual/assets/tags.md b/en/manual/assets/tags.md new file mode 100644 index 000000000..7e86ecf7e --- /dev/null +++ b/en/manual/assets/tags.md @@ -0,0 +1,20 @@ +# Tags + +Beginner + +Assets can be tagged to help with organization and assigning them to [asset bundles](asset-bundles.md). + +Tags aren't available at runtime. They are only used as a tool in **Game Studio** and during compilation in [asset bundles](asset-bundles.md). + +## Add or remove a tag + +An asset's tags are displayed at the top of the **Property grid**. + +![](media/property-grid-tags.webp) + +You can remove a tag by clicking 🗙 and add a new one in the **Add a new tag** box. + +## See also + +* [Edit an asset](edit-an-asset.md) +* [Asset bundles](asset-bundles.md) diff --git a/en/manual/assets/use-an-asset-in-code.md b/en/manual/assets/use-an-asset-in-code.md new file mode 100644 index 000000000..ff33dfad4 --- /dev/null +++ b/en/manual/assets/use-an-asset-in-code.md @@ -0,0 +1,91 @@ +# Use an asset in code + +Beginner +Programmer + +There are a few ways of using assets in code: + +* [**Referencing**](#referencing-an-asset) - the easiest way, creates an assignable reference in the **Property grid**. +* [**Url reference**](#url-reference) - creates an assignable reference in the **Property grid**, but let's you handle loading and unloading manually (most commonly used with **scenes**). +* [**Loading from path**](#loading-from-path) - a manual way of loading assets based on their path. + +## Referencing an asset + +The easiest way of using an asset in your own script is to **create an assignable reference** using a public property or field. + +```csharp +public class Example : StartupScript +{ + public Model ModelAsset { get; set; } +} +``` + +The above will show up in the **Property grid** like so: + +![Image of the script in the Property grid showing the property with the text "No asset selected", two icons of a hand and an eraser and an empty square with a hand icon.](media/property-grid-direct-reference-example.webp) + +Stride will automatically handle loading and unloading. If you want more control over how assets are loaded, consider using a [url reference](#url-reference) instead. + +## Url reference + +**Url references** provide a way of assigning an asset in the Property grid **without loading it**. + +You can create an assignable url reference to an asset in your own script by using [`UrlReference`](xref:Stride.Core.Serialization.UrlReference`1), where `T` is the asset type you want to use. + +```csharp +public class Example : StartupScript +{ + public UrlReference MyAssetReference { get; set; } +} +``` + +It will show up in the **Property grid** like so: + +![Image of the script in the Property grid showing the property with the text "No asset selected", two icons of a hand and an eraser and an empty square with a hand icon.](media/property-grid-url-reference-example.webp) + +The asset can be loaded via the **content system** by using [`Content.Load`](xref:Stride.Core.Serialization.UrlReferenceContentManagerExtenstions.Load*) or [`Content.LoadAsync`](xref:Stride.Core.Serialization.UrlReferenceContentManagerExtenstions.LoadAsync*) and and then unloaded using [`Content.Unload`](xref:Stride.Core.Serialization.Contents.ContentManager.Unload*). + +```csharp +public override void Start() +{ + var asset = Content.Load(MyAssetReference); +} + +public override void Cancel() +{ + var asset = Content.Unload(MyAssetReference); +} +``` + +[!INCLUDE [content-loading-warning](../../includes/content-loading-warning.md)] + +## Loading from path + +Assets can also be loaded based on their path in the **assets** folder directly through code, **without having to assign anything**. + +This is done via the **content system** using [`Content.Load`](xref:Stride.Core.Serialization.Contents.ContentManager.Load``1(System.String,Stride.Core.Serialization.Contents.ContentManagerLoaderSettings)) or [`Content.LoadAsync`](xref:Stride.Core.Serialization.Contents.ContentManager.LoadAsync``1(System.String,Stride.Core.Serialization.Contents.ContentManagerLoaderSettings)) and then unloading is done using [`Content.Unload`](xref:Stride.Core.Serialization.Contents.ContentManager.Unload*). + +```csharp +public override void Start() +{ + var loadedModel = Content.Load("path/to/asset"); +} + +public override void Cancel() +{ + Content.Unload("path/to/asset"); +} +``` + +[!INCLUDE [content-loading-warning](../../includes/content-loading-warning.md)] + +### Missing assets + +The asset compiler only knows which assets to include in the build based on their references. When loading assets only from a path, **Stride doesn't know that the asset is needed**. + +To fix that, you can [mark the missing assets as root](asset-compilation.md#how-to-mark-an-asset-as-root) to make sure they are always included with the build, or try using [url references](#url-reference) instead. + +## See also + +* [Use an asset](use-an-asset.md) +* [Asset compilation](asset-compilation.md) diff --git a/en/manual/assets/use-an-asset.md b/en/manual/assets/use-an-asset.md new file mode 100644 index 000000000..9c907d65a --- /dev/null +++ b/en/manual/assets/use-an-asset.md @@ -0,0 +1,40 @@ +# Use an asset + +Beginner + +Assets can be referenced by other assets or components in a scene. + +## Components and other assets + +In the **Property grid**, you can sometimes find a property that looks like this: + +![](media/property-grid-asset-reference.webp) + +In here, you can assign a reference to another asset. There are two available buttons: + +* **Hand** - opens up a dialogue to select an existing asset. +* **Eraser** - clears the reference. + +> [!TIP] +> You can also **drag and drop** an asset from the **Asset view**. +> +> ![](media/property-grid-asset-reference-drag-and-drop.webp) + +## Your own scripts + +You can create an assignable reference to an asset in your script by creating a property or field with an asset type. + +```csharp +public Model ModelAsset { get; set; } +``` + +This will show up in the **Property grid** like so: + +![](media/property-grid-direct-reference-example.webp) + +This way, the asset will be loaded automatically. Stride also provides a way of **managing loading manually**. For more information, visit [Use an asset in code](use-an-asset-in-code.md). + +## See also + +* [Use an asset in code](use-an-asset-in-code.md) +* [Asset compilation](asset-compilation.md) diff --git a/en/manual/engine/assets/asset-bundles.md b/en/manual/engine/assets/asset-bundles.md index 4b7d74c75..aa09001bc 100644 --- a/en/manual/engine/assets/asset-bundles.md +++ b/en/manual/engine/assets/asset-bundles.md @@ -1,113 +1,3 @@ -# Asset bundles - ->[!Warning] ->This section is out of date. For now, you should only use it for reference. - -A bundle of assets allows to package assets into a single archive that can be downloaded into the game at a specific time. - -It allows creation of **Downloadable Content (DLC)**. - -Basic rules: - -- A project can generate several bundle. -- A bundle is created from several **assets selectors** (Currently, only the `PathSelector` and `TagSelector` are supported) -- A bundle can have dependencies to others bundles -- Every bundle implicitly references `default` bundle, where every asset which shouldn't go in a specific bundle will be packaged -- Once a bundle is deployed into the game, all assets from this bundle and all its dependencies are accessible -- Bundle resolution is done through an asynchronous callback that allows you to download bundle, and will be called once per dependency (similar to AssemblyResolve event). - -# Create a bundle - -> [!Note] -> Creating currently requires some manual steps (i.e. editing `sdpkg` by hand). - -Open the `sdprj` file of the game executable and add the following configuration: - -Example: - -- A bundle named `MyBundleName` will embed assets with tags `MyTag1` and `MyTag2` -- A bundle named `MyBundleName2` will embed assets with tags `MyTag3` and `MyTag4`. This bundle has a dependency to `MyBundleName` -- There is also a `PathSelector` which follow the `.gitignore` filtering convention. - - - -```cs -Bundles: - - Name: MyBundleName - Selectors: - - !TagSelector - Tags: - - MyTag1 - - MyTag2 - - Name: MyBundleName2 - Dependencies: - - MyBundleName - Selectors: - - !TagSelector - Tags: - - MyTag3 - - MyTag4 - - !PathSelector - Paths: - - folder1/ - - /folder2/ - - *.bin - - folder3/*.xml -``` - - -> [!Note] -> -> Asset dependencies are automatically placed in the most appropriate bundle. -> -> Current process works that way: -> -> - Find assets that matches specific Tag Selectors ("roots" of bundle assets). -> - Enumerate assets that are dependent on those "roots" bundle assets and put them in the same bundle than their "roots" asset. -> - Except if already accessible through one of package dependencies (i.e. a shared dependent package or default package). -> - Place everything else in default bundle. -> -> Note that: -> -> - Shared assets might be duplicated if not specifically placed in common or default package, but that is intended (i.e. if user wishes to distribute 2 separate DLC that need common assets but need to be self-contained). -> - Every bundle implicitly depends on default bundle. -> -> - -# Load a bundle at runtime - -Loading bundle is done through `ObjectDatabase.LoadBundle(string bundleName) (ref:{Stride.Core.Storage.ObjectDatabase.LoadBundle})`: - -```cs -// Load bundle -Assets.DatabaseFileProvider.ObjectDatabase.LoadBundle("MyBundleName2"); - -// Load specified asset -var texture = Assets.Load("AssetContainedInMyBundleName2"); -``` - - -# Selectors - - Selectors help deciding which assets are stored in a specific bundle. - -## Tag selector - -Select assets based on a list of tag attached on each asset. - -Properties: - -- Tags: List of Tags. Any asset that contains at least one of the tag will be included. - -## Path selector - -Select assets based on their path. - -Standard .gitignore patterns are supported (except ! (negate), # (comments) and \[0-9\] (groups)). - -Properties: - -- Paths: List of filters. Any asset whose URL matches one of the filter will be included. - - - +--- +redirect_url: ../../assets/asset-bundles.html +--- diff --git a/en/manual/engine/assets/asset-control.md b/en/manual/engine/assets/asset-control.md index 257d0ce70..b8b0dc538 100644 --- a/en/manual/engine/assets/asset-control.md +++ b/en/manual/engine/assets/asset-control.md @@ -1,40 +1,3 @@ -# Asset control - ->[!Warning] ->This section is out of date. For now, you should only use it for reference. - -Until now, all assets of a game package, and its dependencies, were compiled as part of your game. - -Starting with 1.3, we compile only the assets required by your game. - -Don’t worry, most of it is done automatically for you! We do that by starting to collect dependencies from the new Game Setting asset: it references the Default Scene, and we can easily detect all the required asset references (Models, Materials, Asset referenced by your scripts and so on). - -In case you were loading anything in your script using Content.Load, you can still tag those assets specifically with “Mark as Root” in the editor. - -However, we now recommend to instead create a field in your script and fill it directly in the editor. All the samples have been updated to this new practice, so please check them out. - -## Which assets are compiled? - -Assets that will be compiled and packaged in your project are: - -- **Root assets (blue)** - - **Automatic** for a few asset types (i.e. Game Settings, Shaders) - - Explicit (using "**Mark as Root**" on the asset) -- **Dependencies of root assets (green)** - - Since Game Settings is collected, that means that Default Scene and all its dependencies will be compiled as well (includes Model, Script field members pointing to other assets, etc...) - - Also, we encourage our users to switch your script from Content.Load (which require "Mark as Root") to a field member that you can set within the editor using drag and drop. That will create an implicit dependency that will force that asset to be compiled as well. -- **Everything else (white)** (objects not marked as root and not referenced directly or indirectly by a root) **won't be packaged** - -![media/26968245.png](media/26968245.png) - -## "Mark as root" - -One important thing to understand is that "Mark as root" is not part of the asset, it is stored in the "current" package (the one that is in bold in the Solution Explorer). - -It means that if "MyGame" is current package, if you check "Mark as Root" on Silver Material (part of SharedPackage), this information will be stored in MyGame.sdpkg as part of the reference to SharedPackage. - -As a result, you can use a shared package from multiple games even if you have different explicit roots. - -## See also - -For additional information about asset management, see [Manage Assets](../../game-studio/manage-assets.md) \ No newline at end of file +--- +redirect_url: ../../assets/asset-compilation.html +--- diff --git a/en/manual/engine/assets/index.md b/en/manual/engine/assets/index.md index 6de4eeaf6..88f29c3a6 100644 --- a/en/manual/engine/assets/index.md +++ b/en/manual/engine/assets/index.md @@ -1,80 +1,3 @@ -# Asset manager - ->[!Warning] ->This section is out of date. For now, you should only use it for reference. - -# Assets - -After creating your assets in Game Studio, @'Stride.Core.Serialization.Assets.AssetManager' is the class responsible for loading, unloading and saving assets. - -## Creating - -You usually create assets directly in Game Studio. - -Their URL will match the name (including folder) in Game Studio. - -Examples of URLs: - -- knight (user imports knight.fbx directly in main asset folder) -- level1/room1 (user creates level1 and import room1.fbx inside) - -For more information, see [Assets](../../game-studio/assets.md) for more details. - -## Loading - -Loading an asset should be done with the help of @'Stride.Core.Serialization.Assets.AssetManager' class: - -```cs -// Load an asset directly from a file: -var texture = Content.Load("texture1"); - -// Load a Scene asset -var scene = Content.Load("scenes/scene1"); - -// Load an Entity asset -var entity = Content.Load("entity1"); -``` - -Note that loading an asset that has already been loaded only increment the reference counter and do not reload the asset. - -## Unloading - -Unloading is also done using the AssetManager class: - -```cs - Asset.Unload(asset); -``` - - -## Asset life time - -Asset load and unload are working in pairs. For each call to 'load', a corresponding call to 'unload' is expected. - -An asset is actually loaded only during the first call to 'load'. All subsequent calls only result to an asset reference increment. - -An asset is actually unload only when the number of call to unload match the number of call the load. - -The @'Stride.Core.Serialization.Assets.AssetManager.Get' method returns the reference to a loaded asset but does not increment the asset reference counter. - -```cs - var firstReference = Content.Load("MyTexture"); // load the asset and increase the reference counter (ref count = 1) - -// the texture can be used here - -var secondReference = Content.Load("MyTexture"); // only increase the reference counter (ref count = 2) - -// the texture can still be used here - -Asset.Unload(firstReference); // decrease the reference counter (ref count = 1) - -// the texture can still be used here - -Asset.Get("MyTexture"); // return the loaded asset without increasing the reference counter (ref count = 1) - -// the texture can still be used here -Asset.Unload(secondReference); // decrease the reference counter and unload the asset (ref count = 0) - -// The texture has been unloaded, it cannot be used here any more. -``` - - +--- +redirect_url: ../../assets/index.html +--- diff --git a/en/manual/engine/assets/media/26968245.png b/en/manual/engine/assets/media/26968245.png deleted file mode 100644 index c6f9f128e..000000000 --- a/en/manual/engine/assets/media/26968245.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:44f21c5d931bc482171c6ab44519c4495e03c31a20e5f372cb10b3c850ec4f4c -size 19444 diff --git a/en/manual/engine/assets/media/9503662.png b/en/manual/engine/assets/media/9503662.png deleted file mode 100644 index 77d3ab19d..000000000 --- a/en/manual/engine/assets/media/9503662.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62aa56167a7bfd85c3618ecb0860854d83ceaebff2e8b181d24a84c92f9a1cfc -size 11021 diff --git a/en/manual/engine/index.md b/en/manual/engine/index.md index a50cb82c8..967cedaeb 100644 --- a/en/manual/engine/index.md +++ b/en/manual/engine/index.md @@ -3,7 +3,6 @@ >[!Warning] >This section is out of date. For now, you should only use it for reference. -- [Asset](assets/index.md) - [Entity-component system](entity-component-system/index.md) - [File system](file-system.md) - [Build pipeline](build-pipeline.md) @@ -11,5 +10,5 @@ # See also -- [Introduction to assets](../game-studio/assets.md) -- [Scripts](../scripts/index.md) \ No newline at end of file +- [Assets](../assets/index.md) +- [Scripts](../scripts/index.md) diff --git a/en/manual/files-and-folders/project-packages/package-properties.md b/en/manual/files-and-folders/project-packages/package-properties.md index 8bd96e6e4..d248285cf 100644 --- a/en/manual/files-and-folders/project-packages/package-properties.md +++ b/en/manual/files-and-folders/project-packages/package-properties.md @@ -14,7 +14,7 @@ Every project package contains it's own set of properties, that can be customize | ResourceFolders | List of directory paths that contain resources. | | OutputGroupDirectories | A dictionary containing a custom output directory for each specified bundle name. | | ExplicitFolders (currently broken) | List of directory paths that are meant to always be loaded by **Game Studio**, even if they do not contain any assets. | -| Bundles | List of bundles and their metadata. For more information read [Asset Bundles](../../engine/assets/asset-bundles.md). | +| Bundles | List of bundles and their metadata. For more information read [Asset Bundles](../../assets/asset-bundles.md). | | TemplateFolders | List of directory paths containing custom templates in the `.sdtpl` format. For more information read [Custom Assets](../../scripts/custom-assets.md#adding-a-section-for-the-add-asset-menu-inside-the-editor). | | RootAssets | List of root assets (assets that will always be included with the build). | diff --git a/en/manual/game-studio/archetypes.md b/en/manual/game-studio/archetypes.md index 03d129028..72e8a4d6e 100644 --- a/en/manual/game-studio/archetypes.md +++ b/en/manual/game-studio/archetypes.md @@ -1,71 +1,3 @@ -# Archetypes - -Intermediate -Designer - -An **archetype** is a master asset that controls the properties of assets you **derive** from it. Derived assets are useful when you want to create a "remixed" version of an asset. - -For example, imagine we have three sphere entities that share a material asset named *Metal*. The Metal asset has properties including color, gloss, and so on. - -![Three metal spheres](media/archetypes-three-spheres-metal.webp) - -If we change a property in the **Metal** asset, it applies to all three spheres. So, for example, if we change the color property, all three spheres change color. - -![Three gold spheres](media/archetypes-three-spheres-gold.webp) - -Now imagine we want to change the color of only *one* sphere, but keep its other properties the same. We could duplicate the material asset, change its color, and then apply the new asset to only one sphere. But if we later want to change a different property across *all* the spheres, we have to modify both assets. This is time-consuming and leaves room for mistakes. - -The better approach is to derive a new asset from the archetype. The derived asset inherits properties from the archetype and lets you override individual properties where you need them. For example, we can derive the sphere's material asset and override its color. Then, if we change the gloss of the archetype, the gloss of all three spheres changes. - -![Create derived asset](media/archetypes-three-spheres.png) - -You can derive an asset from an archetype, then in turn derive another asset from that derived asset. This way you can create different layers of assets to keep your project organized: - -```cs -Archetype - Derived asset - Derived asset -``` - -## Derive an asset from an archetype - -In the **Asset View**, right-click the asset you want to derive an asset from and select **Create derived asset**: - -![Create derived asset](media/archetypes-create-derived-asset.png) - -Game Studio adds a new **derived asset** to the project. This asset derives its properties from the **archetype** asset. - -The derived asset properties display the archetype asset under **Archetype**: - -![Derived asset in Property Grid](media/archetypes-archetype-in-property-grid.png) - -You can right-click the archetype asset in the Property Grid and select **Select the referenced asset** to quickly select the archetype asset: - -![Select referenced asset](media/archetypes-select-the-referenced-asset.png) - -### Overridden properties - -The **Property Grid** shows which properties of the derived asset differ from the archetype. **Overridden** and **unique** properties are **white**, and **inherited** (identical) properties are **gray**. - -In this screenshot, the **Diffuse Map** property is overridden. The other properties are inherited: - -![Overridden properties are white](media/archetypes-overriden-properties-appear-white.png) - -### Reset a property to archetype value - -You can reset overridden or unique properties of a derived asset to the values in the archetype. To do this, right-click the overridden property and select **Reset to base value**. - -![Reset to base value](media/archetypes-reset-property-to-base-value.png) - -### Clear an archetype - -You can remove the link between the archetype and the derived asset. This means the derived asset no longer inherits changes to the archetype; it becomes a completely independent. - -To do this, in the **Asset View**, right-click the derived asset and select **Clear archetype**. - -![Clear archetype](media/archetypes-clear-archetypes.png) - -## See also - -* [Assets](../game-studio/assets.md) -* [Prefabs](prefabs/index.md) \ No newline at end of file +--- +redirect_url: ../assets/archetypes.html +--- diff --git a/en/manual/game-studio/assets.md b/en/manual/game-studio/assets.md index f55f8b1fd..bd0c9991e 100644 --- a/en/manual/game-studio/assets.md +++ b/en/manual/game-studio/assets.md @@ -1,35 +1,3 @@ -# Assets - -Beginner - -An **asset** is a representation of an element of your game inside Game Studio, such as a texture, animation, or model. - -Some assets require **resource files**. For example, texture assets need image files and audio assets need audio files. Other types of assets (such as scenes, physics colliders, and game settings) don't use resource files, and can be created entirely in Game Studio. - -You can compile and optimize assets with a special compiler provided by Stride. Compiled assets are packed together as reusable bundles. - -![Assets displayed in the Asset View](../get-started/media/asset-creation-asset-view-tab-knight.png) - -You can: - -* create and browse assets in the **Asset View** - - ![media/Editor2_assetview_thumb.jpg](media/Editor2_assetview_thumb.jpg) - -* import existing assets, such as FBX files - - ![media/EditorImportAssets_explorer_thumb.jpg](media/EditorImportAssets_explorer_thumb.jpg) - -* edit assets in the **property editor** - - ![media/EditorProperties_props_thumb.jpg](media/EditorProperties_props_thumb.jpg) - -* see a live preview in the **Asset Preview** - - ![media/EditorProperties_preview_thumb.jpg](media/EditorProperties_preview_thumb.jpg) - -## In this section - -* [Create assets](create-assets.md) -* [Manage assets](manage-assets.md) -* [Use assets](use-assets.md) \ No newline at end of file +--- +redirect_url: ../assets/index.html +--- diff --git a/en/manual/game-studio/create-assets.md b/en/manual/game-studio/create-assets.md index f470775f9..7b1277a97 100644 --- a/en/manual/game-studio/create-assets.md +++ b/en/manual/game-studio/create-assets.md @@ -1,66 +1,3 @@ -# Create assets - -Beginner - -There are two ways to create assets: - -* Use the **Add asset** button in the **Asset View** -* Drag and drop **resource files** (such as image or audio files) to the **Asset View** tab - -## Use the **Add asset** button - - 1. In the *Asset View*, click ![](media/create-and-add-assets-add-new-asset-button.png) - - 2. Select the type of asset you want to create. - - ![Select asset type](../get-started/media/asset-creation-create-new-asset-asset-view-tab.png) - - Game Studio displays a list of asset templates. These are assets configured for a specific use. - - 3. Select the right template for your asset. - - Game Studio adds the asset to the Asset View: - - ![Asset added to Asset View' tab](../get-started/media/asset-creation-asset-view-tab-procedural-model.png) - -> [!Note] -> Some assets, such as textures, require a resource file. When you add these assets, Game Studio prompts you for a resource file. - -## Drag and drop resource files - -You can drag compatible resource files directly into Game Studio to create assets from them. Game Studio is compatible with common file formats. - -> [!NOTE] -> * You can't use this method to create assets that don't use resource files (eg prefabs, materials, or scenes). - -| Asset type | Compatible resource file formats -|-------------------------------|---------------------------------- -| Models, animations, skeletons | .dae, .3ds, obj, .blend, .x, .md2, .md3, .dxf, .fbx -| Sprites, textures, skyboxes | .dds, .jpg, .jpeg, .png, .gif, .bmp, .tga, .psd, .tif, .tiff -| Audio | .wav, .mp3, .ogg, .aac, .aiff, .flac, .m4a, .wma, .mpc - -To create an asset by dragging and dropping a resource file: - -1. (Optional) If it isn't there already, move the resource file you want to use in the **Resources** folder of your project. You don't have to do this, but it's good practice to keep resource files organized and makes projects easier to share. For more information, see [Project structure](../files-and-folders/project-structure.md). - -2. Drag the resource file from Explorer to the Asset View: - - ![Drap and drop a resource file to the Asset View](media/create-assets-drop-resource.png) - -3. Select the kind of asset you want to create: - - ![List of asset templates](media/create-assets-drag-drop-select-asset-template.png) - - Game Studio adds the asset to the Asset View: - - ![Texture asset created](media/create-assets-drag-drop-asset-created.png) - -Game Studio automatically imports all dependencies in the resource files and creates corresponding assets. For example, you can add a model or animation resource file and Game Studio handles everything else. - -> [!TIP] -> You can drag multiple files simultaneously. If you drop multiple files of different types at the same time, Game Studio only adds only files that match your template selection. For example, if you add an image file and a sound file, then select the audio asset template, only the sound file is added. - -## See also - -* [Manage assets](manage-assets.md) -* [Use assets](use-assets.md) \ No newline at end of file +--- +redirect_url: ../assets/create-an-asset.html +--- diff --git a/en/manual/game-studio/game-settings.md b/en/manual/game-studio/game-settings.md index b42e02d50..be4190f24 100644 --- a/en/manual/game-studio/game-settings.md +++ b/en/manual/game-studio/game-settings.md @@ -225,4 +225,4 @@ For more information, see [Splash screen](/splash-screen.md). ## See also -* [Assets](../game-studio/assets.md) \ No newline at end of file +* [Assets](../assets/index.md) diff --git a/en/manual/game-studio/index.md b/en/manual/game-studio/index.md index 8fb8650f4..63579de4c 100644 --- a/en/manual/game-studio/index.md +++ b/en/manual/game-studio/index.md @@ -36,11 +36,6 @@ You can show and hide different parts of the Game Studio in the View menu. You c * [Load scenes](load-scenes.md) * [Add entities](add-entities.md) * [Manage entities](manage-entities.md) -* [Assets](assets.md) - * [Create assets](create-assets.md) - * [Use assets](use-assets.md) - * [Archetypes](archetypes.md) - * [Game settings](game-settings.md) * [Prefabs](prefabs/index.md) * [Create a prefab](prefabs/create-a-prefab.md) * [Use prefabs](prefabs/use-prefabs.md) diff --git a/en/manual/game-studio/load-scenes.md b/en/manual/game-studio/load-scenes.md index 0c89cc44a..31c58ed70 100644 --- a/en/manual/game-studio/load-scenes.md +++ b/en/manual/game-studio/load-scenes.md @@ -32,7 +32,7 @@ myChildScene1.Add(myChildScene2); >To include a scene in the build, in the **Asset View**, right-click the scene asset and select **Include in build as root asset**. ->For more information about including assets in the build, see [Manage assets](manage-assets.md). +>For more information about including assets in the build, see [Asset compilation](../assets/asset-compilation.md). For more information about scene hierarchies, see [Manage scenes](manage-scenes.md). @@ -110,4 +110,4 @@ At runtime, when the trigger you created in step 1 is triggered, Stride loads th * [Navigate in the Scene Editor](navigate-in-the-scene-editor.md) * [Manage scenes](manage-scenes.md) * [Add entities](add-entities.md) -* [Manage entities](manage-entities.md) \ No newline at end of file +* [Manage entities](manage-entities.md) diff --git a/en/manual/game-studio/manage-assets.md b/en/manual/game-studio/manage-assets.md index a3034cfa4..a76c6a412 100644 --- a/en/manual/game-studio/manage-assets.md +++ b/en/manual/game-studio/manage-assets.md @@ -1,149 +1,3 @@ -# Manage assets - -Beginner - -This page explains how to edit and manage your assets. - -## Edit assets in the Property Grid - -You can edit most assets using the **Property Grid**. By default, this is in the top-right of Game Studio. - -For example, to change the color of a material asset:: - - 1. In the **Asset View** (in the bottom by default), select the material. - - ![Select material in the Asset View](../get-started/media/edit-asset-sphere-material-asset-view-tab.png) - - 2. In the Property Grid, under **Shading > Diffuse**, next to **Diffuse Map**, click the **colored box**, which displays the asset color (yellow in this example). - - The color picker opens. - - ![Color picker and Palette](../get-started/media/edit-asset-color-picker-palette-diffuse.png) - - 4. Select a new color for the asset. - - ![Asset is now red](../get-started/media/edit-asset-color-change-selected-asset.png) - -The **Asset Preview** (bottom right by default) displays asset changes in real time. - -The **Asset View** indicates assets with unsaved changes with asterisks (*). - -![Unsaved changes](../get-started/media/asset-unsaved-changes.png) - -## Edit assets using dedicated editors - -Game Studio has dedicated editors for the following asset types: - -* prefabs -* scenes -* sprite sheets -* UI pages -* UI libraries -* scripts - -For example, you edit scenes in the **Scene Editor**. - -![Scene Editor](media/manage-assets-scene-editor.png) - -To open the dedicated editor for these types of asset: - -* double-click the asset, or -* right-click the asset and select **Edit asset**, or -* select the asset and type **Ctrl + Enter** - -## Organize assets - -We recommend you organize your assets into subfolders by type. This makes projects much easier to manage, especially as they become large. - -![Organized project](media/manage-assets-organized-project.png) - -Assets are contained in the **Assets** folder of your project package. You can see the project in the **Solution Explorer** (by default shown in the bottom left). - -* To create a subfolder, right-click the parent folder and select **Create subfolder**. -* To move an asset, select one or more assets in the **Asset View** and drag and drop them to the folder. - -> [!NOTE] -> When you move an asset, Game Studio updates all references to other assets inside the asset. - -> [!TIP] -> To see the URL and type of an asset, move the mouse over the asset thumbnail. -> ![Details of new asset in Asset View tab](../get-started/media/asset-creation-solution-explorer.png) - -## Include assets in the build - -By default, Stride doesn't include every asset when you build the game. This is because you might not need every asset at runtime — for example, if the asset is incomplete. - -Stride only includes assets which: - -* you've specifically marked for inclusion (**root assets**), or -* are **referenced** by a root asset - -Game Studio indicates whether an asset is included with a colored icon in the top-left of the asset thumbnail. - -Color | Status -------|-------- -Blue


![Blue](media/manage-assets-reference-asset.png)


| The asset is a root asset and included in the build. -Green


![Green](media/manage-assets-include-asset.png)


| The asset is referenced by a root asset and included in the build. -Gray


![Gray](media/manage-assets-exclude-asset.png)


| The asset isn't included in the build. - -If you plan to load an asset at runtime using scripts, make it a root asset. To do this: - -* click the **gray dot** in the top-left of the thumbnail, or - -* right-click the asset and select **Include in build as root asset** - - ![Include in build as root asset](media/right-click-include-in-build-as-root-asset.png) - -## Asset View options - -To change the Asset View options, click the eye icon in the Asset View toolbar. - -![Asset View options](../get-started/media/asset-view-options.png) - -You can: - -* display assets in the selected folder only, the selected folder and subfolder -* sort assets by name, type, unsaved changes, and modification date -* switch between tile view (default) and grid view - -## Filter assets - -When browsing assets in the **Asset View** (in the bottom by default), you can filter by name, tag, type, or a combination of all three. - -The tag and name filters are "and" filters. For example, if you filter by *tag:level* and *name:knight*, the Asset View only displays assets with the tag "level" **and** the name "knight". - -Type filters are "or" filters. For example, if you filter by *type:animation* and *type:texture*, the Asset View only displays assets that are animations **or** textures. - -### Add a filter - -1. In the Asset View, type in the filter bar. - - Game Studio displays a list of matching filters (name, type, or tag). - - ![add-filter.png](media/add-filter.png) - -2. To filter by name, press **Enter**. - - To filter by a tag or type, select **tag** or **type** filters in the drop-down list. - - Game Studio applies the filter and shows matching assets in the Asset View. - -You can add multiple filters. Name filters are green, tag filters are blue, and type filters are orange. - -![filter-tags](media/filter-tags.png) - -### Toggle filters on and off - -To toggle a filter on and off without removing it, click it. Disabled filters have darker colors. - -![filter-tags](../get-started/media/disabled-filter-tags.png) - -### Remove a filter - -To remove a filter, click the X icon in the filter tag. - -## See also - -* [Create assets](create-assets.md) -* [Manage assets](manage-assets.md) -* [Use assets](use-assets.md) \ No newline at end of file +--- +redirect_url: ../assets/asset-compilation.html +--- diff --git a/en/manual/game-studio/prefabs/index.md b/en/manual/game-studio/prefabs/index.md index 12e3a20aa..7204fb80a 100644 --- a/en/manual/game-studio/prefabs/index.md +++ b/en/manual/game-studio/prefabs/index.md @@ -28,4 +28,4 @@ You can [override specific properties](override-prefab-properties.md) in each pr * [Nested prefabs](nested-prefabs.md) * [Override prefab properties](override-prefab-properties.md) * [Prefab models](prefab-models.md) -* [Archetypes](../archetypes.md) \ No newline at end of file +* [Archetypes](../../assets/archetypes.md) diff --git a/en/manual/game-studio/prefabs/prefab-models.md b/en/manual/game-studio/prefabs/prefab-models.md index 226c0c2a5..1feadc735 100644 --- a/en/manual/game-studio/prefabs/prefab-models.md +++ b/en/manual/game-studio/prefabs/prefab-models.md @@ -38,4 +38,4 @@ Prefab models don't expose materials. This means you can't view or edit them in * [Edit prefabs](edit-prefabs.md) * [Nested prefabs](nested-prefabs.md) * [Override prefab properties](override-prefab-properties.md) -* [Archetypes](../archetypes.md) \ No newline at end of file +* [Archetypes](../../assets/archetypes.md) diff --git a/en/manual/game-studio/use-assets.md b/en/manual/game-studio/use-assets.md index e0faa3d79..44e0cb33c 100644 --- a/en/manual/game-studio/use-assets.md +++ b/en/manual/game-studio/use-assets.md @@ -1,175 +1,3 @@ -# Use assets - -Beginner - -There are four ways to use assets: - -* reference them in entity components -* reference them in other assets -* load them from code as content -* load them from code as content using `UrlReference` - -## Reference assets in components - -Many kinds of component use assets. For example, model components use model assets. - -Components that use assets have **asset docks** in the **property grid**. - -![Select an asset](media/use-assets-asset-picker-dock.png) - -To add an asset to an entity component, drag the asset to the asset dock in the component properties (in the **property grid**). You can drop assets in the text field or the empty thumbnail. - -![Drag and drop an asset](media/use-assets-drag-and-drop.png) - -Alternatively, click ![Hand icon](~/manual/game-studio/media/hand-icon.png) (**Select an asset**). - -![Select an asset](media/use-assets-asset-picker.png) - -The **Select an asset** window opens. - -> [!NOTE] -> The **Select an asset** window only displays assets of types expected by the component. For example, if the component is an audio listener, the window only displays audio assets. - -After you add an asset to a component, the asset dock displays its name and a thumbnail image. - -![Asset displayed](media/asset-displayed.png) - -## Reference assets in other assets - -Assets can reference other assets. For example, a model asset might use material assets. - -You can add asset references to assets the same way you add them to entity components (see above). - -## Clear a reference - -To clear a reference to an asset, in the **asset dock**, click ![eraser](media/use-assets-eraser.png) (**Clear reference**). - -![Use eraser](media/use-eraser.png) - -## Examine references - -You can see the references in a selected asset in the **References** tab. By default, this is in the bottom right of Game Studio. - -![References tab](media/use-assets-references-tab.png) - -* The **References** tab displays the assets referenced by the selected asset. -* The **Referenced by** tab displays the assets that reference the selected asset. - -> [!Tip] -> If you can't see the References tab, make sure it's displayed under **View > References**. - -## Load assets from code - -When loading in assets at runtime we speak of "Content" rather than assets. The loaded content refers to the asset and can then be used in your script. - -```cs -// Load a model (replace URL with valid URL) -var model = Content.Load("AssetFolder/MyModel"); - -// Create a new entity to add to the scene -Entity entity = new Entity(position, "Entity Added by Script") { new ModelComponent { Model = model } }; - -// Add a new entity to the scene -SceneSystem.SceneInstance.RootScene.Entities.Add(entity); -``` - -> [!TIP] -> To find the asset URL, in Game Studio, move the mouse over the asset. Game Studio displays the asset URL in a tooltip. URLs typically have the format *AssetFolder/AssetName*. -> [!WARNING] -> When loading assets from scripts, make sure you: -> -> * include the asset in the build as described in [Manage assets](manage-assets.md) -> * make sure you add the script as a component to an entity in the scene - -### Unload unneeded assets - -When loading content from code, you should unload content when you don't need them any more. If you don't, content stays in memory, wasting GPU. - -To unload an asset, use ``Content.Unload(myAsset)``. - -## Load assets from code using UrlReference - -`UrlReference` allows you to reference assets in your scripts the same way you would with normal assets but they are loaded dynamically in code. Referencing an asset with a `UrlReference` causes the asset to be included in the build. - -You can reference assets in your scripts using properties/fields of type `UrlReference` or `UrlReference`: - -* `UrlReference` can be used to reference any asset. This is most useful for the "Raw asset". -* `UrlReference` can be used to specify the desired type. i.e. `UrlReference`. This gives Game Studio a hint about what type of asset this `UrlReference` can be used for. - -## Examples - -### Loading a Scene - -Using `UrlReference` to load the next scene. - -```cs -using System.Threading.Tasks; -//Include the Stride.Core.Serialization namespace to use UrlReference -using Stride.Core.Serialization; -using Stride.Engine; - -namespace Examples -{ - public class UrlReferenceExample : AsyncScript - { - public UrlReference NextSceneUrl { get; set; } - - public override async Task Execute() - { - //... - } - - private async Task LoadNextScene() - { - //Dynamically load next scene asynchronously - var nextScene = await Content.LoadAsync(NextSceneUrl); - SceneSystem.SceneInstance.RootScene = nextScene; - } - } -} -``` - -### Load data from a Raw asset JSON file - -Use a Raw asset to store data in a JSON file and load using [Newtonsoft.Json](https://www.newtonsoft.com/json). To use `Newtonsoft.Json` you also need to add the `Newtonsoft.Json` NuGet package to the project. - -```cs -//Include the Newtonsoft.Json namespace. -using Newtonsoft.Json; -using System.IO; -using System.Threading.Tasks; -//Include the Stride.Core.Serialization namespace to use UrlReference -using Stride.Core.Serialization; -using Stride.Engine; - -namespace Examples -{ - public class UrlReferenceExample : AsyncScript - { - public UrlReference RawAssetUrl { get; set; } - - public override async Task Execute() - { - //... - } - - private async Task LoadMyData() - { - //Open a StreamReader to read the content - using (var stream = Content.OpenAsStream(RawAssetUrl)) - using (var streamReader = new StreamReader(stream)) - { - //read the raw asset content - string json = await streamReader.ReadToEndAsync(); - //Deserialize the JSON to your custom MyDataClass Type. - return JsonConvert.DeserializeObject(json); - } - } - } -} -``` - -## See also - -* [Create assets](create-assets.md) -* [Manage assets](manage-assets.md) +--- +redirect_url: ../assets/use-an-asset.html +--- diff --git a/en/manual/get-started/assets.md b/en/manual/get-started/assets.md index b4f556580..daaf6234d 100644 --- a/en/manual/get-started/assets.md +++ b/en/manual/get-started/assets.md @@ -6,39 +6,32 @@ An asset is a representation of an element of your game inside Game Studio, such ## Create an asset -To create an asset, click the "Add Asset" button in the **Asset View** and select the type of asset you want to create. +To create an asset, click the **➕ Add assets** button in the **Asset view** and select the type of asset you want to create. -![Image of the "Add Asset" menu in the asset view.](media/asset-view-create-new.webp) +![](../assets/media/asset-view-create-new.webp) ## Create assets from resources -To create an asset from a resource, simply drag and drop it from a folder. +To create an asset from a resource, simply drag and drop it into the **Asset view** and select the type of asset you want to create. -Then, select the type of resource you want to create. +![](../assets/media/asset-view-from-resource-type.webp) -![Popup showing a list of assets that can be created from the dragged resource.](media/asset-view-from-resource-type.webp) +If the resource isn't present in the resources folder, **Game Studio** will ask you if you want to move it there. In the majority of cases, **you will want to click yes**. -You will be asked, if you want to **copy the dragged file to the resources folder**. Most of the time, **you want to do this**, in order to make the project easier to share and use version control with. +![](../assets/media/asset-view-copy-resource.webp) -![A popup "Source file 'C:/Users/franc/Downloads/Grass0044K-PNG/Grass0044K-PNG_Color.png' is not inside of your project's resource folders, do you want to copy it?" with two options "yes" and "no".](media/asset-view-copy-resource.webp) +Finally, you will be asked if you want to **move it to the default location**. Again, most of the time **you will want to do this**, unless you need more control over where resources end up. -Finally, you will be asked if you want to **move it to the default location**. Again, most of the time **you want to do this**, unless you need more control over where resources end up. +![](../assets/media/asset-view-resource-default-location.webp) -![A popup "Do you want to place the resource in the default location ?" with two options "yes" and "no"](media/asset-view-resource-default-location.webp) +## Blue, green and gray dots -## Green, blue and gray dots +[!INCLUDE [asset-status-dots](../../includes/asset-status-dots.md)] -![A screenshot of three items in the Asset View, all having a small circle in the top left corner of their icon with one being blue, one green and one gray.](media/asset-view-indicators.webp) +Stride doesn't include assets which aren't used anywhere, meaning that **they cannot be accessed when running the game**. In order to ensure, that an asset will always be included in the build, right click on it and select **🔵 Include in build as root asset**. -Every asset has a little dot in the top left corner of their icon. This dot indicates if an asset is going to be included when building the project: -* **Blue** - the asset will be included in the build no matter if it's needed or not. -* **Green** - the asset will be included in the build, because a different asset needs it. -* **Gray** - the asset will not be included in the build. - -Stride doesn't include assets which aren't used anywhere, meaning that **they cannot be accessed when running the game**. In order to ensure, that an asset will always be included in the build, right click on it and select **Include in build as root asset**. - -![A screenshot of an asset's context menu, highlighting an item "Include in build as root asset".](media/asset-view-include-root.webp) +![](../assets/media/asset-view-include-root.webp) ## Further reading -For more information, visit the [Assets](../game-studio/assets.md) page. +For more information, visit the [Assets](../assets/index.md) page. diff --git a/en/manual/glossary/index.md b/en/manual/glossary/index.md index 1193d74ca..ef312ce32 100644 --- a/en/manual/glossary/index.md +++ b/en/manual/glossary/index.md @@ -22,14 +22,13 @@ ## Asset terms -- [Archetype](../game-studio/archetypes.md): A template for asset properties that other assets can inherit from. -- [Asset](../game-studio/assets.md): Content used by the game (models, textures, materials, scripts, etc.) managed by the asset pipeline. +- [Archetype](../assets/archetypes.md): A template for asset properties that other assets can inherit from. +- [Asset](../assets/index.md): Content used by the game (models, textures, materials, scripts, etc.) managed by the asset pipeline. - Asset URL: The path used in code to load an asset, for example with `Content.Load("MyFolder/MyAsset")`. See [Create a model from code](../scripts/create-a-model-from-code.md) and [Create a script](../scripts/create-a-script.md). -- [Asset bundles](../engine/assets/asset-bundles.md): Groups of assets packaged for deployment/streaming. -- [Asset control](../engine/assets/asset-control.md): Control asset loading, references, and lifetime. -- [Build pipeline](../engine/build-pipeline.md): Compiles assets into runtime-ready formats. +- [Asset compilation](../assets/asset-compilation.md): Compiles assets into runtime-ready formats. +- [Asset bundles](../assets/asset-bundles.md): Groups of assets packaged for deployment/streaming. - [Prefab](../game-studio/prefabs/index.md): A reusable entity hierarchy that can be instantiated at design time or runtime. -- Root asset: An asset included in the build so it is available at runtime. See [Manage assets](../game-studio/manage-assets.md). +- [Root asset](../assets/asset-compilation.md#root-assets): An asset included in the build so it is available at runtime. ## Audio terms @@ -51,9 +50,9 @@ ## Editor terms - [Add entities](../game-studio/add-entities.md): Create new entities in a scene. -- [Archetypes](../game-studio/archetypes.md): Share default properties across assets. -- [Asset View](../game-studio/assets.md): Panel used to manage assets in your project. -- [Create assets](../game-studio/create-assets.md): Create and organize project assets. +- [Archetypes](../assets/archetypes.md): Share default properties across assets. +- [Asset View](../assets/index.md): Panel used to manage assets in your project. +- [Create assets](../assets/create-an-asset.md): Create and organize project assets. - [Game settings](../game-studio/game-settings.md): Project-wide defaults such as the graphics compositor and rendering options. - [Graphics compositor editor](../graphics/graphics-compositor/index.md): Node-based editor to configure the rendering pipeline. - [Manage entities](../game-studio/manage-entities.md): Select, group, and organize entities. @@ -62,7 +61,7 @@ - [Property Grid](../game-studio/index.md): Panel used to view and edit properties of selected entities/components. - [Scene Editor](../game-studio/scenes.md): The 3D/2D viewport for arranging entities in a scene. - [Splash screen](../game-studio/splash-screen.md): Configure startup visuals. -- [Use assets](../game-studio/use-assets.md): Reference and place assets in scenes. +- [Use assets](../assets/use-an-asset.md): Reference and place assets in scenes. - [World units](../game-studio/world-units.md): Scene scale conventions (unit size, conversions). ## General terms diff --git a/en/manual/scripts/create-a-model-from-code.md b/en/manual/scripts/create-a-model-from-code.md index 3cb087d69..ad99522fa 100644 --- a/en/manual/scripts/create-a-model-from-code.md +++ b/en/manual/scripts/create-a-model-from-code.md @@ -40,7 +40,7 @@ You can create models in scripts at runtime. You can do this in several differen ![Include in build as root asset](media/create-model-from-code-include-in-build-as-root-asset.png) - This makes sure the asset is available for the script to use at runtime. For more information, see [Manage assets](../game-studio/manage-assets.md). + This makes sure the asset is available for the script to use at runtime. For more information, see [Asset compilation](../assets/asset-compilation.md). ## Create a procedural model @@ -137,7 +137,7 @@ Finally, you need to give the model one or more materials. There are two ways to ![Include in build as root asset](media/create-model-from-code-include-material-in-build-as-root-asset.png) - This makes sure the asset is available for the script to use at runtime. For more information, see [Manage assets](../game-studio/manage-assets.md). + This makes sure the asset is available for the script to use at runtime. For more information, see the [Use an asset in code](../assets/use-an-asset-in-code.md). ### Option 2: Create new materials in code diff --git a/en/manual/sprites/import-sprite-sheets.md b/en/manual/sprites/import-sprite-sheets.md index 0028af29e..c7c4cba59 100644 --- a/en/manual/sprites/import-sprite-sheets.md +++ b/en/manual/sprites/import-sprite-sheets.md @@ -30,4 +30,4 @@ You can import sprite sheets (image files containing sprites) just like any othe * [Edit sprites](edit-sprites.md) * [Use sprites](use-sprites.md) -* [Assets](../game-studio/assets.md) +* [Assets](../assets/index.md) diff --git a/en/manual/stride-for-godot-developers/index.md b/en/manual/stride-for-godot-developers/index.md index e0aea0933..59679c11c 100644 --- a/en/manual/stride-for-godot-developers/index.md +++ b/en/manual/stride-for-godot-developers/index.md @@ -202,7 +202,7 @@ Like Godot, Stride supports file formats including: | Fonts | .ttf, .otf | | Video | .mp4 -For more information about assets, see [Assets](../game-studio/assets.md). +For more information about assets, see [Assets](../assets/index.md). ## Prefab inheritance diff --git a/en/manual/stride-for-unity-developers/index.md b/en/manual/stride-for-unity-developers/index.md index 6119255cd..86d35a22b 100644 --- a/en/manual/stride-for-unity-developers/index.md +++ b/en/manual/stride-for-unity-developers/index.md @@ -223,7 +223,7 @@ Like Unity®, Stride supports file formats including: | Fonts | `.ttf`, `.otf` | | Video | `.mp4` | -For more information about assets, see [Assets](../game-studio/assets.md). +For more information about assets, see [Assets](../assets/index.md). ## Prefabs @@ -255,7 +255,7 @@ Archetype Derived asset ``` -For more information about archetypes, see [Archetypes](../game-studio/archetypes.md). +For more information about archetypes, see [Archetypes](../assets/archetypes.md). ## Object lifetime diff --git a/en/manual/toc.yml b/en/manual/toc.yml index 15a981155..d91ca9307 100644 --- a/en/manual/toc.yml +++ b/en/manual/toc.yml @@ -60,6 +60,26 @@ items: - name: Custom attributes href: animation/custom-attributes.md + - name: Assets + href: assets/index.md + items: + - name: Create an asset + href: assets/create-an-asset.md + - name: Edit an asset + href: assets/edit-an-asset.md + - name: Use an asset + href: assets/use-an-asset.md + - name: Use an asset in code + href: assets/use-an-asset-in-code.md + - name: Tags + href: assets/tags.md + - name: Archetypes + href: assets/archetypes.md + - name: Asset compilation + href: assets/asset-compilation.md + - name: Asset bundles + href: assets/asset-bundles.md + - name: Audio href: audio/index.md items: @@ -92,13 +112,6 @@ items: - name: Engine href: engine/index.md items: - - name: Assets - href: engine/assets/index.md - items: - - name: Asset bundles - href: engine/assets/asset-bundles.md - - name: Asset control - href: engine/assets/asset-control.md - name: ECS (Entity Component System) href: engine/entity-component-system/index.md items: @@ -133,17 +146,6 @@ items: href: game-studio/add-entities.md - name: Manage entities href: game-studio/manage-entities.md - - name: Assets - href: game-studio/assets.md - items: - - name: Create assets - href: game-studio/create-assets.md - - name: Manage assets - href: game-studio/manage-assets.md - - name: Use assets - href: game-studio/use-assets.md - - name: Archetypes - href: game-studio/archetypes.md - name: Prefabs href: game-studio/prefabs/index.md items: diff --git a/en/manual/video/set-up-a-video.md b/en/manual/video/set-up-a-video.md index a1a837236..52bc90199 100644 --- a/en/manual/video/set-up-a-video.md +++ b/en/manual/video/set-up-a-video.md @@ -18,7 +18,7 @@ ## 1. Add a video asset -Before you can use a video in your game, you need to import it as an [asset](../game-studio/assets.md). +Before you can use a video in your game, you need to import it as an [asset](../assets/index.md). 1. Drag the video file from **Explorer** into the **Asset View**. @@ -122,4 +122,4 @@ myVideoComponent.Instance.Play(); ## See also -* [Video properties](video-properties.md) \ No newline at end of file +* [Video properties](video-properties.md) diff --git a/en/tutorials/csharpbeginner/loading-content.md b/en/tutorials/csharpbeginner/loading-content.md index 36fbd46db..68fba1927 100644 --- a/en/tutorials/csharpbeginner/loading-content.md +++ b/en/tutorials/csharpbeginner/loading-content.md @@ -6,7 +6,7 @@ This C# Beginner tutorial covers how to load content from code. Assets like models, textures, sound etc can be loaded from during runtime. At that point we no longer speak of assets but of 'content'. -This tutorial specifically loads content of the `Model` type. Loaded content that is no longer required in your scene, should be unloaded again so save up memory. For more information on assets see [Manage assets](../../manual/game-studio/manage-assets.md). +This tutorial specifically loads content of the `Model` type. Loaded content that is no longer required in your scene, should be unloaded again so save up memory. For more information on assets see [Use an asset in code](../../manual/assets/use-an-asset-in-code.md). ![Loading content](media/loading-content.webp)