docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UserSetting<T>

    A generic implementation of IUserSetting to be used with a Settings instance. This default implementation assumes the Settings instance contains two ISettingsRepository, one for Project and one for User.

    Inheritance
    object
    UserSetting<T>
    Implements
    IUserSetting
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEditor.SettingsManagement
    Assembly: solution.dll
    Syntax
    public class UserSetting<T> : IUserSetting
    Type Parameters
    Name Description
    T

    Constructors

    Name Description
    UserSetting(Settings, string, string, T, SettingsScope)

    Constructor for UserSetting{T} type.

    UserSetting(Settings, string, T, SettingsScope)

    Constructor for UserSetting{T} type.

    Properties

    Name Description
    defaultValue
    key
    scope

    The scope affects which ISettingsRepository the settings instance will save it's data to.

    settings
    settingsRepositoryName

    The name of the ISettingsRepository that this setting should be associated with. If null, the first repository matching the scope will be used.

    type
    value

    Methods

    Name Description
    ApplyModifiedProperties()

    When the inspected type is a reference value, it is possible to change properties without affecting the backing setting. ApplyModifiedProperties provides a method to force serialize these changes.

    Delete(bool)

    Delete the saved setting. Does not clear the current value.

    GetDefaultValue()

    Get a copy of the default value.

    GetValue()

    Get the currently stored value.

    Reset(bool)

    Set the current value back to the default.

    SetValue(object, bool)

    Set the value for this setting.

    SetValue(T, bool)

    Set the value for this setting.

    ToString()

    Get a summary of this setting.

    Operators

    Name Description
    implicit operator T(UserSetting<T>)

    Implicit cast to backing type.

    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)