Class ContentUpdateScript
Contains methods used for the content update workflow.
Inherited Members
Namespace: UnityEditor.AddressableAssets.Build
Syntax
public static class ContentUpdateScript
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.
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 (list is empty if there are none); null if failed to load cache data. |
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(String, List<AddressableAssetEntry>, IDependencyData, String, String)
Save the content update information for a set of AddressableAssetEntry objects.
Declaration
[Obsolete]
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. |