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.HighDefinition
Syntax
public struct MaterialHeaderScope : IDisposable
Constructors
MaterialHeaderScope(String, UInt32, MaterialEditor, Boolean, Color, 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, Color colorDot = default(Color), 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. |
Color | colorDot | Specify a color to display a dot, like in the layered UI. |
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. |
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 |