docs.unity.cn
    Show / Hide Table of Contents

    Class UserSettingAttribute

    A custom attribute for registering a static field of type IUserSetting for the UserSettingsProvider window.

    Inheritance
    Object
    UserSettingAttribute
    Namespace: UnityEditor.SettingsManagement
    Syntax
    public sealed class UserSettingAttribute : Attribute

    Constructors

    UserSettingAttribute()

    Registers a static field as a setting. Fields must be of a type that implements IUserSetting.

    Declaration
    public UserSettingAttribute()

    UserSettingAttribute(String, String, String)

    Registers a static field as a setting and creates an entry in the UI. The field must be of a type that implements IUserSetting.

    Declaration
    public UserSettingAttribute(string category, string title, string tooltip = null)
    Parameters
    Type Name Description
    String category

    The category to assign this setting to.

    String title

    The display text for this setting in the UI.

    String tooltip

    Optional. The tooltip for this setting.

    Properties

    category

    Gets the name of the group (category) to assign this settings value to. When Unity finds settings values in assemblies, it displays them in groups, organized by category.

    Declaration
    public string category { get; }
    Property Value
    Type Description
    String

    The group or category where this setting appears in the UI.

    title

    Gets the label to show for this setting.

    Declaration
    public GUIContent title { get; }
    Property Value
    Type Description
    GUIContent

    The label that appears beside this setting in the UI.

    visibleInSettingsProvider

    True to show this field in the UserSettingsProvider interface; false if not.

    Declaration
    public bool visibleInSettingsProvider { get; }
    Property Value
    Type Description
    Boolean
    Back to top Copyright © 2021 Unity Technologies
    Generated by DocFX
    on Monday, December 6, 2021
    Terms of use