Struct MaterialHeaderScope
Create a toggleable header for material UI, must be used within a scope.
void OnGUI()
{
    using (var header = new MaterialHeaderScope(text, ExpandBit, editor))
    {
        if (header.expanded)
            EditorGUILayout.LabelField("Hello World !");
    }
}
Namespace: UnityEditor.Rendering
Syntax
public struct MaterialHeaderScope : IDisposable
Constructors
MaterialHeaderScope(String, UInt32, MaterialEditor, Boolean, Boolean)
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.  | 
| UInt32 | 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.  | 
| Boolean | 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.  | 
| Boolean | 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, UInt32, MaterialEditor, Boolean, Boolean, UInt32, 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 = 4294967295U, string documentationURL = "")
Parameters
| Type | Name | Description | 
|---|---|---|
| GUIContent | title | GUI Content of the header.  | 
| UInt32 | 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.  | 
| Boolean | 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.  | 
| Boolean | 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.  | 
| UInt32 | 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 | 
|---|---|
| Boolean |