Method SetValue
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 identifier of the specified profile. |
string | variableName | The name to set the profile property to. |
string | val | The value to set the profile property to. |
Remarks
The variable must exist in order to have its value set. Use CreateValue to create the variable if needed.
Examples
The example below uses SetValue to change the value of the remote load path variable.
public void UpdateRemoteLoadPath()
{
AddressableAssetSettings settings = AddressableAssetSettingsDefaultObject.Settings;
AddressableAssetProfileSettings profileSettings = settings.profileSettings;
string activeProfileId = settings.activeProfileId;
string variableName = AddressableAssetSettings.kRemoteLoadPath;
profileSettings.SetValue(activeProfileId, variableName, "https://myhost/mycontent");
AssetDatabase.SaveAssetIfDirty(settings);
}