Method CloneMaterials
CloneMaterials(Renderer)
Clones and replaces all materials assigned to a Renderer
Declaration
public static Material[] CloneMaterials(Renderer renderer)
Parameters
| Type | Name | Description |
|---|---|---|
| Renderer | renderer | Renderer assigned the materials to clone and replace. |
Returns
| Type | Description |
|---|---|
| Material[] | Cloned materials |
Remarks
Warning
You must call Destroy(Object, bool) on each cloned material object in the array when done.