C# Class UnityEditor.ShaderGUI

Abstract class to derive from for defining custom GUI for shader properties and for extending the material preview.

Mostrar archivo Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
AssignNewShaderToMaterial ( Material material, Shader oldShader, Shader newShader ) : void

This method is called when a new shader has been selected for a Material.

OnGUI ( MaterialEditor materialEditor, MaterialProperty properties ) : void

To define a custom shader GUI use the methods of materialEditor to render controls for the properties array.

OnMaterialInteractivePreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void
OnMaterialPreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void

Override for extending the rendering of the Preview area or completly replace the preview (by not calling base.OnMaterialPreviewGUI).

OnMaterialPreviewSettingsGUI ( MaterialEditor materialEditor ) : void

Override for extending the functionality of the toolbar of the preview area or completly replace the toolbar by not calling base.OnMaterialPreviewSettingsGUI.

Protected Methods

Method Description
FindProperty ( string propertyName, MaterialProperty properties ) : MaterialProperty

Find shader properties.

FindProperty ( string propertyName, MaterialProperty properties, bool propertyIsMandatory ) : MaterialProperty

Find shader properties.

ShaderGUI ( ) : System

Method Details

AssignNewShaderToMaterial() public method

This method is called when a new shader has been selected for a Material.

public AssignNewShaderToMaterial ( Material material, Shader oldShader, Shader newShader ) : void
material UnityEngine.Material The material the newShader should be assigned to.
oldShader UnityEngine.Shader Previous shader.
newShader UnityEngine.Shader New shader to assign to the material.
return void

FindProperty() protected static method

Find shader properties.

protected static FindProperty ( string propertyName, MaterialProperty properties ) : MaterialProperty
propertyName string Name of the material property.
properties MaterialProperty The array of available properties.
return MaterialProperty

FindProperty() protected static method

Find shader properties.

protected static FindProperty ( string propertyName, MaterialProperty properties, bool propertyIsMandatory ) : MaterialProperty
propertyName string Name of the material property.
properties MaterialProperty The array of available properties.
propertyIsMandatory bool If true then this method will throw an exception if a property with propertyName was not found.
return MaterialProperty

OnGUI() public method

To define a custom shader GUI use the methods of materialEditor to render controls for the properties array.

public OnGUI ( MaterialEditor materialEditor, MaterialProperty properties ) : void
materialEditor MaterialEditor The MaterialEditor that are calling this OnGUI (the 'owner').
properties MaterialProperty Material properties of the current selected shader.
return void

OnMaterialInteractivePreviewGUI() public method

public OnMaterialInteractivePreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void
materialEditor MaterialEditor
r UnityEngine.Rect
background UnityEngine.GUIStyle
return void

OnMaterialPreviewGUI() public method

Override for extending the rendering of the Preview area or completly replace the preview (by not calling base.OnMaterialPreviewGUI).

public OnMaterialPreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void
materialEditor MaterialEditor The MaterialEditor that are calling this method (the 'owner').
r UnityEngine.Rect Preview rect.
background UnityEngine.GUIStyle Style for the background.
return void

OnMaterialPreviewSettingsGUI() public method

Override for extending the functionality of the toolbar of the preview area or completly replace the toolbar by not calling base.OnMaterialPreviewSettingsGUI.

public OnMaterialPreviewSettingsGUI ( MaterialEditor materialEditor ) : void
materialEditor MaterialEditor The MaterialEditor that are calling this method (the 'owner').
return void

ShaderGUI() protected method

protected ShaderGUI ( ) : System
return System