docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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);
    

    }

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)