C# Класс UnityEditor.ShaderGUI

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

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
FindProperty ( string propertyName, MaterialProperty properties ) : MaterialProperty

Find shader properties.

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

Find shader properties.

ShaderGUI ( ) : System

Описание методов

AssignNewShaderToMaterial() публичный метод

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.
Результат void

FindProperty() защищенный статический метод

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.
Результат MaterialProperty

FindProperty() защищенный статический метод

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.
Результат MaterialProperty

OnGUI() публичный метод

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.
Результат void

OnMaterialInteractivePreviewGUI() публичный метод

public OnMaterialInteractivePreviewGUI ( MaterialEditor materialEditor, Rect r, GUIStyle background ) : void
materialEditor MaterialEditor
r UnityEngine.Rect
background UnityEngine.GUIStyle
Результат void

OnMaterialPreviewGUI() публичный метод

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.
Результат void

OnMaterialPreviewSettingsGUI() публичный метод

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').
Результат void

ShaderGUI() защищенный метод

protected ShaderGUI ( ) : System
Результат System