Class BuildScriptBase
Base class for build script assets
Namespace: UnityEditor.AddressableAssets.Build.DataBuilders
Syntax
public class BuildScriptBase : ScriptableObject, IDataBuilder
Fields
instanceProviderType
The type of instance provider to create for the Addressables system.
Declaration
public SerializedType instanceProviderType
Field Value
| Type | Description | 
|---|---|
| SerializedType | 
sceneProviderType
The type of scene provider to create for the addressables system.
Declaration
public SerializedType sceneProviderType
Field Value
| Type | Description | 
|---|---|
| SerializedType | 
Properties
Name
The descriptive name used in the UI.
Declaration
public virtual string Name { get; }
Property Value
| Type | Description | 
|---|---|
| String | 
Implements
Methods
BuildData<TResult>(AddressablesDataBuilderInput)
Build the specified data with the provided builderInput. This is the public entry point. Child class overrides should use BuildDataImplementation<TResult>(AddressablesDataBuilderInput)
Declaration
public TResult BuildData<TResult>(AddressablesDataBuilderInput builderInput)
    where TResult : IDataBuilderResult
Parameters
| Type | Name | Description | 
|---|---|---|
| AddressablesDataBuilderInput | builderInput | The builderInput object used in the build.  | 
Returns
| Type | Description | 
|---|---|
| TResult | The build data result.  | 
Type Parameters
| Name | Description | 
|---|---|
| TResult | The type of data to build.  | 
Implements
BuildDataImplementation<TResult>(AddressablesDataBuilderInput)
The implementation of BuildData<TResult>(AddressablesDataBuilderInput). That is the public entry point, this is the home for child class overrides.
Declaration
protected virtual TResult BuildDataImplementation<TResult>(AddressablesDataBuilderInput builderInput)
    where TResult : IDataBuilderResult
Parameters
| Type | Name | Description | 
|---|---|---|
| AddressablesDataBuilderInput | builderInput | The builderInput object used in the build  | 
Returns
| Type | Description | 
|---|---|
| TResult | The build data result  | 
Type Parameters
| Name | Description | 
|---|---|
| TResult | The type of data to build  | 
CanBuildData<T>()
Used to determine if this builder is capable of building a specific type of data.
Declaration
public virtual bool CanBuildData<T>()
    where T : IDataBuilderResult
Returns
| Type | Description | 
|---|---|
| Boolean | True if this builder can build this data.  | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type of data needed to be built.  | 
Implements
ClearCachedData()
Used to clean up any cached data created by this builder.
Declaration
public virtual void ClearCachedData()
Implements
CreateLocationsForPlayerData(PlayerDataGroupSchema, AddressableAssetGroup, List<ContentCatalogDataEntry>, HashSet<Type>)
Utility method for creating locations from player data.
Declaration
protected bool CreateLocationsForPlayerData(PlayerDataGroupSchema playerDataSchema, AddressableAssetGroup assetGroup, List<ContentCatalogDataEntry> locations, HashSet<Type> providerTypes)
Parameters
| Type | Name | Description | 
|---|---|---|
| PlayerDataGroupSchema | playerDataSchema | |
| AddressableAssetGroup | assetGroup | The group to extract the locations from.  | 
| List<ContentCatalogDataEntry> | locations | The list of created locations to fill in.  | 
| HashSet<Type> | providerTypes | Any unknown provider types are added to this set in order to ensure they are not stripped.  | 
Returns
| Type | Description | 
|---|---|
| Boolean | True if any legacy locations were created. This is used by the build scripts to determine if a legacy provider is needed.  | 
DeleteFile(String)
Utility method for deleting files.
Declaration
protected static void DeleteFile(string path)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | path | The file path to delete.  | 
IsDataBuilt()
Checks to see if the data is built for the given builder.
Declaration
public virtual bool IsDataBuilt()
Returns
| Type | Description | 
|---|---|
| Boolean | 
ProcessAllGroups(AddressableAssetsBuildContext)
Loops over each group, after doing some data checking.
Declaration
protected virtual string ProcessAllGroups(AddressableAssetsBuildContext aaContext)
Parameters
| Type | Name | Description | 
|---|---|---|
| AddressableAssetsBuildContext | aaContext | The Addressables builderInput object to base the group processing on  | 
Returns
| Type | Description | 
|---|---|
| String | An error string if there were any problems processing the groups  | 
ProcessGroup(AddressableAssetGroup, AddressableAssetsBuildContext)
Build processing of an individual group.
Declaration
protected virtual string ProcessGroup(AddressableAssetGroup assetGroup, AddressableAssetsBuildContext aaContext)
Parameters
| Type | Name | Description | 
|---|---|---|
| AddressableAssetGroup | assetGroup | The group to process  | 
| AddressableAssetsBuildContext | aaContext | The Addressables builderInput object to base the group processing on  | 
Returns
| Type | Description | 
|---|---|
| String | An error string if there were any problems processing the groups  | 
WriteFile(String, String, FileRegistry)
Utility method to write a file. The directory will be created if it does not exist.
Declaration
protected static bool WriteFile(string path, string content, FileRegistry registry)
Parameters
| Type | Name | Description | 
|---|---|---|
| String | path | The path of the file to write.  | 
| String | content | The content of the file.  | 
| FileRegistry | registry | The file registry used to track all produced artifacts.  | 
Returns
| Type | Description | 
|---|---|
| Boolean | True if the file was written.  |