Class ContentUpdateScript
Contains methods used for the content update workflow.
Namespace: UnityEditor.AddressableAssets.Build
Syntax
public static class ContentUpdateScript : object
Fields
GroupFilterFunc
Functor to filter AddressableAssetGroups during content update. If the functor returns false, the group is excluded from the update.
Declaration
public static Func<AddressableAssetGroup, bool> GroupFilterFunc
Field Value
| Type | Description |
|---|---|
| Func<AddressableAssetGroup, Boolean> |
Methods
BuildContentUpdate(AddressableAssetSettings, String)
Builds player content using the player content version from a specified cache file.
Declaration
public static AddressablesPlayerBuildResult BuildContentUpdate(AddressableAssetSettings settings, string contentStateDataPath)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings | The settings object to use for the build. |
| String | contentStateDataPath | The path of the cache data to use. |
Returns
| Type | Description |
|---|---|
| AddressablesPlayerBuildResult | The build operation. |
CreateContentUpdateGroup(AddressableAssetSettings, List<AddressableAssetEntry>, String)
Create a new AddressableAssetGroup with the items and mark it as remote.
Declaration
public static void CreateContentUpdateGroup(AddressableAssetSettings settings, List<AddressableAssetEntry> items, string groupName)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings | The settings object. |
| List<AddressableAssetEntry> | items | The items to move. |
| String | groupName | The name of the new group. |
GatherModifiedEntries(AddressableAssetSettings, String)
Get all modified addressable asset entries in groups that have BundledAssetGroupSchema and ContentUpdateGroupSchema with static content enabled. This includes any Addressable dependencies that are affected by the modified entries.
Declaration
public static List<AddressableAssetEntry> GatherModifiedEntries(AddressableAssetSettings settings, string cacheDataPath)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings | Addressable asset settings. |
| String | cacheDataPath | The cache data path. |
Returns
| Type | Description |
|---|---|
| List<AddressableAssetEntry> | A list of all modified entries and dependencies (list is empty if there are none); null if failed to load cache data. |
GatherModifiedEntriesWithDependencies(AddressableAssetSettings, String)
Get a Dictionary of all modified values and their dependencies. Dependencies will be Addressable and part of a group with static content enabled.
Declaration
public static Dictionary<AddressableAssetEntry, List<AddressableAssetEntry>> GatherModifiedEntriesWithDependencies(AddressableAssetSettings settings, string cachePath)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings | settings | Addressable asset settings. |
| String | cachePath | The cache data path. |
Returns
| Type | Description |
|---|---|
| Dictionary<AddressableAssetEntry, List<AddressableAssetEntry>> | A dictionary mapping explicit changed entries to their dependencies. |
GetContentStateDataPath(Boolean)
Gets the path of the cache data from a selected build.
Declaration
public static string GetContentStateDataPath(bool browse)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | browse | If true, the user is allowed to browse for a specific file. |
Returns
| Type | Description |
|---|---|
| String |
LoadContentState(String)
Loads cache data from a specific location
Declaration
public static AddressablesContentState LoadContentState(string contentStateDataPath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | contentStateDataPath |
Returns
| Type | Description |
|---|---|
| AddressablesContentState | The ContentState object. |
SaveContentState(List<ContentCatalogDataEntry>, String, List<AddressableAssetEntry>, IDependencyData, String, String)
Save the content update information for a set of AddressableAssetEntry objects.
Declaration
public static bool SaveContentState(List<ContentCatalogDataEntry> locations, string path, List<AddressableAssetEntry> entries, IDependencyData dependencyData, string playerVersion, string remoteCatalogPath)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ContentCatalogDataEntry> | locations | The ContentCatalogDataEntry locations that were built into the Content Catalog. |
| String | path | File to write content stat info to. If file already exists, it will be deleted before the new file is created. |
| List<AddressableAssetEntry> | entries | The entries to save. |
| IDependencyData | dependencyData | The raw dependency information generated from the build. |
| String | playerVersion | The player version to save. This is usually set to AddressableAssetSettings.PlayerBuildVersion. |
| String | remoteCatalogPath | The server path (if any) that contains an updateable content catalog. If this is empty, updates cannot occur. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the file is saved, false otherwise. |
SaveContentState(List<ContentCatalogDataEntry>, String, List<AddressableAssetEntry>, IDependencyData, String, String, List<CachedAssetState>)
Save the content update information for a set of AddressableAssetEntry objects.
Declaration
public static bool SaveContentState(List<ContentCatalogDataEntry> locations, string path, List<AddressableAssetEntry> entries, IDependencyData dependencyData, string playerVersion, string remoteCatalogPath, List<CachedAssetState> carryOverCacheState)
Parameters
| Type | Name | Description |
|---|---|---|
| List<ContentCatalogDataEntry> | locations | The ContentCatalogDataEntry locations that were built into the Content Catalog. |
| String | path | File to write content stat info to. If file already exists, it will be deleted before the new file is created. |
| List<AddressableAssetEntry> | entries | The entries to save. |
| IDependencyData | dependencyData | The raw dependency information generated from the build. |
| String | playerVersion | The player version to save. This is usually set to AddressableAssetSettings.PlayerBuildVersion. |
| String | remoteCatalogPath | The server path (if any) that contains an updateable content catalog. If this is empty, updates cannot occur. |
| List<CachedAssetState> | carryOverCacheState | Cached state that needs to carry over from the previous build. This mainly affects Content Update. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the file is saved, false otherwise. |
SaveContentState(String, List<AddressableAssetEntry>, IDependencyData, String, String)
Save the content update information for a set of AddressableAssetEntry objects.
Declaration
public static bool SaveContentState(string path, List<AddressableAssetEntry> entries, IDependencyData dependencyData, string playerVersion, string remoteCatalogPath)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | File to write content stat info to. If file already exists, it will be deleted before the new file is created. |
| List<AddressableAssetEntry> | entries | The entries to save. |
| IDependencyData | dependencyData | The raw dependency information generated from the build. |
| String | playerVersion | The player version to save. This is usually set to AddressableAssetSettings.PlayerBuildVersion. |
| String | remoteCatalogPath | The server path (if any) that contains an updateable content catalog. If this is empty, updates cannot occur. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the file is saved, false otherwise. |