Class AddressableAssetProfileSettings
Contains user defined variables to control build parameters.
Namespace: UnityEditor.AddressableAssets.Settings
Syntax
public class AddressableAssetProfileSettings : object
Fields
customEntryString
Text that represents a custom profile entry.
Declaration
public const string customEntryString = null
Field Value
| Type | Description |
|---|---|
| String |
undefinedEntryValue
Text that represents an undefined profile entry.
Declaration
public const string undefinedEntryValue = null
Field Value
| Type | Description |
|---|---|
| String |
Methods
AddProfile(String, String)
Adds a new profile.
Declaration
public string AddProfile(string name, string copyFromId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name of the new profile. |
| String | copyFromId | The id of the profile to copy values from. |
Returns
| Type | Description |
|---|---|
| String | The id of the created profile. |
CreateValue(String, String)
Create a new profile property.
Declaration
public string CreateValue(string variableName, string defaultValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | variableName | The name of the property. |
| String | defaultValue | The default value. |
Returns
| Type | Description |
|---|---|
| String | The id of the created variable. |
EvaluateString(String, String)
Evaluate a string given a profile id.
Declaration
public string EvaluateString(string profileId, string varString)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The profile id to use for evaluation. |
| String | varString | The string to evaluate. Any tokens surrounded by '[' and ']' will be replaced with matching variables. |
Returns
| Type | Description |
|---|---|
| String | The evaluated string. |
GetAllProfileNames()
Get all profile names.
Declaration
public List<string> GetAllProfileNames()
Returns
| Type | Description |
|---|---|
| List<String> | The list of profile names. |
GetAllVariableIds()
Gets the set of all profile ids.
Declaration
public HashSet<string> GetAllVariableIds()
Returns
| Type | Description |
|---|---|
| HashSet<String> | The set of profile ids. |
GetProfileId(String)
Get the id of a given display name.
Declaration
public string GetProfileId(string profileName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileName | The profile name. |
Returns
| Type | Description |
|---|---|
| String | The id of the profile. Returns empty string if not found. |
GetProfileName(String)
Get a profile's display name.
Declaration
public string GetProfileName(string profileId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The profile id. |
Returns
| Type | Description |
|---|---|
| String | The display name of the profile. Returns empty string if not found. |
GetValueById(String, String)
Get the value of a property.
Declaration
public string GetValueById(string profileId, string varId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The profile id. |
| String | varId | The property id. |
Returns
| Type | Description |
|---|---|
| String |
GetValueByName(String, String)
Get the value of a property by name.
Declaration
public string GetValueByName(string profileId, string varName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The profile id. |
| String | varName | The variable name. |
Returns
| Type | Description |
|---|---|
| String |
GetVariableNames()
Get all available variable names
Declaration
public List<string> GetVariableNames()
Returns
| Type | Description |
|---|---|
| List<String> | The variable names, sorted alphabetically. |
RemoveProfile(String)
Removes a profile.
Declaration
public void RemoveProfile(string profileId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The id of the profile to remove. |
RemoveValue(String)
Remove a profile property.
Declaration
public void RemoveValue(string variableId)
Parameters
| Type | Name | Description |
|---|---|---|
| String | variableId | The id of the property. |
RenameProfile(String, String)
Renames a profile. profileId must refer to an existing profile. Profile names must be unique and must not be comprised of only whitespace. Returns false if profileId or newName is invalid.
Declaration
public bool RenameProfile(string profileId, string newName)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The id of the profile to be renamed. |
| String | newName | The new name to be given to the profile. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the rename is successful, false otherwise. |
Reset()
Clears out the list of profiles, then creates a new default one.
Declaration
public string Reset()
Returns
| Type | Description |
|---|---|
| String | Returns the ID of the newly created default profile. |
SetDirty(AddressableAssetSettings.ModificationEvent, Object, Boolean)
Marks the object as modified.
Declaration
public void SetDirty(AddressableAssetSettings.ModificationEvent modificationEvent, object eventData, bool postEvent)
Parameters
| Type | Name | Description |
|---|---|---|
| AddressableAssetSettings.ModificationEvent | modificationEvent | The event type that is changed. |
| Object | eventData | The object data that corresponds to the event. |
| Boolean | postEvent | If true, the event is propagated to callbacks. |
SetValue(String, String, String)
Set the value of a variable for a specified profile.
Declaration
public void SetValue(string profileId, string variableName, string val)
Parameters
| Type | Name | Description |
|---|---|---|
| String | profileId | The profile id. |
| String | variableName | The property name. |
| String | val | The value to set the property. |