Class MaterialUIBlock
Base implementation of a material GUI block to be disabled in the material inspector.
Inherited Members
Namespace: UnityEditor.Rendering.HighDefinition
Assembly: Unity.RenderPipelines.HighDefinition.Editor.dll
Syntax
public abstract class MaterialUIBlockConstructors
MaterialUIBlock()
Default Constructor, you must override the method OnGUI
Declaration
protected MaterialUIBlock()Fields
materialEditor
The current material editor.
Declaration
protected MaterialEditor materialEditorField Value
| Type | Description | 
|---|---|
| MaterialEditor | 
materials
The list of selected materials to edit.
Declaration
protected Material[] materialsField Value
| Type | Description | 
|---|---|
| Material[] | 
parent
Parent of the UI block.
Declaration
protected MaterialUIBlockList parentField Value
| Type | Description | 
|---|---|
| MaterialUIBlockList | 
properties
The list of available properties in the selected materials.
Declaration
protected MaterialProperty[] propertiesField 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 | 
|---|---|
| bool | 
showSection
If the section should be shown
Declaration
protected virtual bool showSection { get; }Property Value
| Type | Description | 
|---|---|
| bool | 
Methods
FindProperty(string, bool)
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. | 
| bool | 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, int, bool)
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. | 
| int | layerCount | Number of layers of the shader. | 
| bool | 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()