C# Class UnityEditor.ShaderGUI

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

Afficher le fichier Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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.
Résultat void

FindProperty() protected static méthode

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.
Résultat MaterialProperty

FindProperty() protected static méthode

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.
Résultat MaterialProperty

OnGUI() public méthode

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.
Résultat void

OnMaterialInteractivePreviewGUI() public méthode

public OnMaterialInteractivePreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void
materialEditor MaterialEditor
r UnityEngine.Rect
background UnityEngine.GUIStyle
Résultat void

OnMaterialPreviewGUI() public méthode

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.
Résultat void

OnMaterialPreviewSettingsGUI() public méthode

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').
Résultat void

ShaderGUI() protected méthode

protected ShaderGUI ( ) : System
Résultat System