SetShader
Sets the shader of the materials that the editor is inspecting, and registers an undo operation.
Read time 1 minuteLast updated 20 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
SetShader(Shader)
Sets the shader of the materials that the editor is inspecting, and registers an undo operation.
public void SetShader(Shader shader)
Parameters
The shader to assign to the materials.
Remarks
The method also rebuilds the inspector for the new shader. To change the shader without undo support, use the overload that takes .
registerUndoSetShader(Shader, bool)
Sets the shader of the materials that the editor is inspecting, with the option to register an undo operation.
public void SetShader(Shader newShader, bool registerUndo)
Parameters
Remarks
The method also rebuilds the inspector for the new shader.