Material Changer

Overview

Allows to change materials on a mesh or meshes on a same gameObject

It uses a List of <Material Items> to set 1 or more material changes to 1 or more meshes at the same time.

You can create any new Material Item by clicking on the Plus(+) button of the list.

Properties

Show/Hide Properties

Shows/Hide the selected Material Item properties.

When you select a Material Item on the list you will have the (Index), the Name, and Button with the Current Material used on the Mesh of that Material Item

Change Hide Meshes [CH]

It will change the material even if the Mesh renderer is Hidden

Random [R]

It will set a random Material on Start on every Material Item. Useful to create random variations

Change Material Button

When you click the Change Material Button it will cycle between all the Materials on the Material Item.This only work on the Editor. For Game purposes use Public methods.

Material Item

The Material Item is a struct class that holds all the Parameters and properties needed to change the material on a single mesh and its LODs

Mesh

Mesh Renderer used to change the materials.

ID

Sometimes a Mesh can have multiple materials assigned. They can me Identified by a Material ID

Unka the Dragon is a single mesh with multiple Materials
Unka has the same mesh on 2 Material Items. ID is 0 for the [Skin] and 1 for [Wings]

Material List

All the Materials a single mesh can cycle trough.

LODs

If a Mesh has LODs you set them here. It will change the same material to multiple to the meshes on the LOD List.

Linked Master

When enabled, a material Item will be Locked and it will only change if the Master Material Item change. The Master property is the Index of the Material Item.

E.g. On the Elemental Dragon the Wings will change automatically to another material when the Body Material Changes

On Material Changed Event

Is invoked when a Material Item changes a material

Public Methods

void Randomize()

Randomize all the Material Items on the Material Changer Component

​

​