docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Set

    Set<T>(string, T, SettingsScope)

    Set a value for key of type T.

    Declaration
    public void Set<T>(string key, T value, SettingsScope scope = SettingsScope.Project)
    Parameters
    Type Name Description
    string key

    The settings key.

    T value

    The value to set. Must be serializable.

    SettingsScope scope

    Which scope this settings should be saved in.

    Type Parameters
    Name Description
    T

    Type of value.

    Set<T>(string, T, string, SettingsScope)

    Set a value for key of type T.

    Declaration
    public void Set<T>(string key, T value, string repositoryName, SettingsScope scope = SettingsScope.Project)
    Parameters
    Type Name Description
    string key

    The settings key.

    T value

    The value to set. Must be serializable.

    string repositoryName

    If provided, only repositories with a matching name will be considered.

    SettingsScope scope

    Which scope this settings should be saved in.

    Type Parameters
    Name Description
    T

    Type of value.

    Set<T, K>(string, T, string)

    Set a value for key of type T.

    Declaration
    public void Set<T, K>(string key, T value, string repositoryName = null) where K : ISettingsRepository
    Parameters
    Type Name Description
    string key

    The settings key.

    T value

    The value to set. Must be serializable.

    string repositoryName

    The name of the repository to set this value in.

    Type Parameters
    Name Description
    T

    Type of value.

    K

    Type of repository to set this value for.

    In This Article
    Back to top
    Copyright © 2024 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)