Class MaterialUIBlock
Base implementation of a material GUI block to be disabled in the material inspector.
Namespace: UnityEditor.Rendering.HighDefinition
Syntax
public abstract class MaterialUIBlock
Constructors
MaterialUIBlock()
Default Constructor, you must override the method OnGUI
Declaration
protected MaterialUIBlock()
Fields
materialEditor
The current material editor.
Declaration
protected MaterialEditor materialEditor
Field Value
Type | Description |
---|---|
MaterialEditor |
materials
The list of selected materials to edit.
Declaration
protected Material[] materials
Field Value
Type | Description |
---|---|
Material[] |
parent
Parent of the UI block.
Declaration
protected MaterialUIBlockList parent
Field Value
Type | Description |
---|---|
MaterialUIBlockList |
properties
The list of available properties in the selected materials.
Declaration
protected MaterialProperty[] properties
Field Value
Type | Description |
---|---|
MaterialProperty[] |
Properties
expandableBit
The MaterialUIBlock.ExpandableBit to store the state of the block
Declaration
public MaterialUIBlock.ExpandableBit expandableBit { get; }
Property Value
Type | Description |
---|---|
MaterialUIBlock.ExpandableBit |
header
The GUIContent used as header of the block
Declaration
public GUIContent header { get; }
Property Value
Type | Description |
---|---|
GUIContent |
isSubHeader
Property that specifies if the scope is a subheader
Declaration
protected virtual bool isSubHeader { get; }
Property Value
Type | Description |
---|---|
Boolean |
showSection
If the section should be shown
Declaration
protected virtual bool showSection { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
FindProperty(String, Boolean)
Find a material property in the list of available properties.
Declaration
protected MaterialProperty FindProperty(string propertyName, bool isMandatory = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of the property. |
Boolean | isMandatory | Specifies whether the property is mandatory for your Inspector. |
Returns
Type | Description |
---|---|
MaterialProperty | Returns the material property if it exists. Returns null otherwise. |
FindPropertyLayered(String, Int32, Boolean)
Find a material property with layering option
Declaration
protected MaterialProperty[] FindPropertyLayered(string propertyName, int layerCount, bool isMandatory = false)
Parameters
Type | Name | Description |
---|---|---|
String | propertyName | Name of the property. |
Int32 | layerCount | Number of layers of the shader. |
Boolean | isMandatory | Specifies whether the property is mandatory for your Inspector. |
Returns
Type | Description |
---|---|
MaterialProperty[] | Returns the material property if it exists. Returns null otherwise. |
LoadMaterialProperties()
Loads the material properties for the block.
Declaration
public abstract void LoadMaterialProperties()
OnGUI()
Renders the properties in the block.
Declaration
public virtual void OnGUI()
OnGUIOpen()
GUI callback when the header is open
Declaration
protected virtual void OnGUIOpen()