Version: 2017.2
public void SetShader (Shader shader);
public void SetShader (Shader newShader, bool registerUndo);

Parameters

shader Shader to set.
registerUndo Should undo be registered.

Description

Set the shader of the material.

Automatically handles internal inspector rebuilding.