Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

MaterialEditor.SetShader

SetShader(shader: Shader): void;
void SetShader(Shader shader);
def SetShader(shader as Shader) as void
SetShader(shader: Shader, registerUndo: bool): void;
void SetShader(Shader shader, bool registerUndo);
def SetShader(shader as Shader, registerUndo as bool) as void

Parameters

shaderShader to set.
registerUndoShould undo be registered.

Description

Set the shader of the material.

Automatically handles internal inspector rebuilding.