docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct MaterialHeaderScope

    Create a toggleable header for material UI, must be used within a scope.

    Implements
    IDisposable
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.Rendering
    Assembly: Unity.RenderPipelines.Core.Editor.dll
    Syntax
    public struct MaterialHeaderScope : IDisposable
    Examples
    void OnGUI()
    {
        using (var header = new MaterialHeaderScope(text, ExpandBit, editor))
        {
            if (header.expanded)
                EditorGUILayout.LabelField("Hello World !");
        }
    }

    Constructors

    MaterialHeaderScope(string, uint, MaterialEditor, bool, bool)

    Creates a material header scope to display the foldout in the material UI.

    Declaration
    public MaterialHeaderScope(string title, uint bitExpanded, MaterialEditor materialEditor, bool spaceAtEnd = true, bool subHeader = false)
    Parameters
    Type Name Description
    string title

    Title of the header.

    uint bitExpanded

    Bit index which specifies the state of the header (whether it is open or collapsed) inside Editor Prefs.

    MaterialEditor materialEditor

    The current material editor.

    bool spaceAtEnd

    Set this to true to make the block include space at the bottom of its UI. Set to false to not include any space.

    bool subHeader

    Set to true to make this into a sub-header. This affects the style of the header. Set to false to make this use the standard style.

    MaterialHeaderScope(GUIContent, uint, MaterialEditor, bool, bool, uint, string)

    Creates a material header scope to display the foldout in the material UI.

    Declaration
    public MaterialHeaderScope(GUIContent title, uint bitExpanded, MaterialEditor materialEditor, bool spaceAtEnd = true, bool subHeader = false, uint defaultExpandedState = 4294967295, string documentationURL = "")
    Parameters
    Type Name Description
    GUIContent title

    GUI Content of the header.

    uint bitExpanded

    Bit index which specifies the state of the header (whether it is open or collapsed) inside Editor Prefs.

    MaterialEditor materialEditor

    The current material editor.

    bool spaceAtEnd

    Set this to true to make the block include space at the bottom of its UI. Set to false to not include any space.

    bool subHeader

    Set to true to make this into a sub-header. This affects the style of the header. Set to false to make this use the standard style.

    uint defaultExpandedState

    The default state if the header is not present

    string documentationURL

    [optional] Documentation page

    Fields

    expanded

    Indicates whether the header is expanded or not. Is true if the header is expanded, false otherwise.

    Declaration
    public readonly bool expanded
    Field Value
    Type Description
    bool

    Implements

    IDisposable

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    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)