initial commit

This commit is contained in:
Jo 2025-01-07 02:06:59 +01:00
parent 6715289efe
commit 788c3389af
37645 changed files with 2526849 additions and 80 deletions

View file

@ -0,0 +1,5 @@
---
uid: samples-addressables-utility
---
# Addressables Utility
This sample contains a set of utility functions for Addressables. Currently, the script contains a static method `GetAddressFromAssetReference` which provides the Addressable address used to reference a given `AssetRefence` internally.

View file

@ -0,0 +1,8 @@
---
uid: samples-component-reference
---
# ComponentReference
This sample creates an AssetReference that is restricted to having a specific Component.
For more information see the ComponentReference sample project located in the [Addressables Samples](https://github.com/Unity-Technologies/Addressables-Sample) repository.

View file

@ -0,0 +1,8 @@
---
uid: samples-custom-analyze-rules
---
# Custom Analyze Rules
This sample shows how to create custom AnalyzeRules for use within the Analyze window. Both rules follow the recommended pattern for adding themselves to the UI.
For more information see the Custom Analyze Rule sample project located in the [Addressables Samples](https://github.com/Unity-Technologies/Addressables-Sample) repository.

View file

@ -0,0 +1,13 @@
---
uid: samples-custom-build-and-playmode-scripts
---
# Custom Build and Playmode Scripts Sample
This sample includes two [custom scripts]: a custom play mode script (located in `Editor/CustomPlayModeScript.cs` of the Sample) and a custom build script (located in `Editor/CustomBuildScript.cs` of the Sample). This custom build script creates a build that only includes the currently open scene. A bootstrap scene is automatically created and a script is added that loads the built scene on startup. The custom play mode script works similarly to the Use Existing Build (requires built groups) play mode script already included. The methods added to accomplish this are `CreateCurrentSceneOnlyBuildSetup` and `RevertCurrentSceneSetup` on the `CustomBuildScript`.
For these examples, the build and load paths used by default are `[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]` and `{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]` respectively.
The `ScriptableObject` of the class has already been created, but the Create menu can be used to make another `ScriptableObject` if you desire. For this `CustomPlayModeScript` the create menu path is **Addressables/Content Builders/Use CustomPlayMode Script**. By default, this creates a CustomPlayMode.asset ScriptableObject. The same goes for the `CustomBuildScript`.
[custom scripts]: xref:addressables-api-build-player-content#custom-build-scripting

View file

@ -0,0 +1,7 @@
---
uid: samples-disable-asset-import-on-build
---
# Disable Asset Import on Build
This sample provides a script that disables asset importing during a player build. This improves build performance since `AssetBundles` are copied into StreamingAssets at build time. This Sample is only relevant for Editor versions below 2021.2. In 2021.2+, the Editor provides the ability to include folders outside of `Assets/` into `StreamingAssets`.
When the sample is imported into the project, a player build without asset importing can be triggered by the new menu item **Build/Disabled Importer Build**. The build output is placed into **DisabledImporterBuildPath/{EditorUserBuildSettings.activeBuildTarget}/** by default. The sample class `DisableAssetImportOnBuild` can be edited to alter the build path.

View file

@ -0,0 +1,7 @@
---
uid: samples-import-existing-group
---
# Import Existing Group
This sample contains a tool that imports group assets (for example from a custom package) to the current project.
The tool is located under **Window/Asset Management/Addressables/Import Groups**. The window requires a path to the `AddressableAssetGroup.asset` scriptable object, a name for the group, and a folder for any schemas related to the imported `AddressableAssetGroup`.

View file

@ -0,0 +1,8 @@
---
uid: samples-prefab-spawner
---
# Prefab Spawner
This sample provides a basic script that instantiates and destroys a prefab `AssetReference`.
In order to use the sample, attach the provided script, `PrefabSpawnerSample`, to a `GameObject` in your scene. Assign an `AdressableAsset` to the `AssetReference` field of that script. If you're using the `Use Existing Build` playmode script, ensure that your Addressable content is built. Then, enter playmode.

View file

@ -0,0 +1,10 @@
---
uid: samples-overview
---
# Addressables Samples
The Addressables package provides a few samples that can be downloaded into your project. Samples are accessed via **Window** > **Package Manager** > **Addressables**.
These samples include examples on how to disable asset importing during a build, creating custom build and playmode scripts, as well as providing an `AddressableUtility` class.
When a sample is downloaded and imported, it is placed inside the `Assets/Samples/Addressables/{AddressablesVersionNumber}` path of your project.