Legacy Documentation: Version 4.6
Language: English
ShaderLab syntax: Fallback
ShaderLab syntax: other commands

ShaderLab syntax: CustomEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

A CustomEditor can be defined for your shader. When you do this Unity will look for a class that extends MaterialEditor with this name. If one is found any material that uses this Shader will use this material inspector. See Custom Material Editors for examples.

Syntax

    CustomEditor "name"

Use the material editor with a given name.

Details

A CustomEditor statement effects all materials that use this Shader

Example

Shader "example" {
    // properties and subshaders here...
    CustomEditor "MyCustomEditor"
}
ShaderLab syntax: Fallback
ShaderLab syntax: other commands