Struct MaterialHeaderScope
Create a toggleable header for material UI, must be used within a scope.
Implements
Inherited Members
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 |