docs.unity3d.com
    Show / Hide Table of Contents

    Class AdditionalPropertiesState<TState, TTarget>

    Used in editor drawer part to store the state of additional properties areas.

    Inheritance
    Object
    AdditionalPropertiesState<TState, TTarget>
    Namespace: UnityEditor.Rendering
    Syntax
    public class AdditionalPropertiesState<TState, TTarget>
        where TState : struct, IConvertible
    Type Parameters
    Name Description
    TState

    An enum to use to describe the state.

    TTarget

    A type given to automatically compute the key.

    Constructors

    AdditionalPropertiesState(TState, String)

    Constructor will create the key to store in the EditorPref the state given generic type passed.

    Declaration
    public AdditionalPropertiesState(TState defaultValue, string prefix = "CoreRP")
    Parameters
    Type Name Description
    TState defaultValue

    If key did not exist, it will be created with this value for initialization.

    String prefix

    [Optional] Prefix scope of the key (Default is CoreRP)

    Properties

    Item[TState]

    Get or set the state given the mask.

    Declaration
    public bool this[TState mask] { get; set; }
    Parameters
    Type Name Description
    TState mask

    The filtering mask

    Property Value
    Type Description
    Boolean

    True: All flagged area are expended

    Methods

    GetAdditionalPropertiesState(TState)

    Accessor to the expended state of this specific mask.

    Declaration
    public bool GetAdditionalPropertiesState(TState mask)
    Parameters
    Type Name Description
    TState mask

    The filtering mask

    Returns
    Type Description
    Boolean

    True: All flagged area are expended

    HideAll()

    Utility to set all states to false

    Declaration
    public void HideAll()

    RegisterEditor(Editor)

    Register an editor for this set of additional properties.

    Declaration
    public void RegisterEditor(Editor editor)
    Parameters
    Type Name Description
    Editor editor

    Editor to register.

    SetAdditionalPropertiesState(TState, Boolean)

    Setter to the expended state.

    Declaration
    public void SetAdditionalPropertiesState(TState mask, bool value)
    Parameters
    Type Name Description
    TState mask

    The filtering mask

    Boolean value

    True to show the additional properties.

    ShowAll()

    Utility to set all states to true

    Declaration
    public void ShowAll()

    UnregisterEditor(Editor)

    Unregister an editor for this set of additional properties.

    Declaration
    public void UnregisterEditor(Editor editor)
    Parameters
    Type Name Description
    Editor editor

    Editor to unregister.

    Extension Methods

    ReflectionUtils.Invoke(Object, String, Object[])
    ReflectionUtils.SetField(Object, String, Object)
    ReflectionUtils.GetField(Object, String)
    ReflectionUtils.GetFields(Object)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023