Get a material at index on a gameObject and store it in a variable
Game Object
The Game Object that the material is applied to.
Material Index
The index of the material to get.
Material
Store the material in a variable.
Get Shared Material
Get the shared material of this object. NOTE: Modifying the shared material will change the appearance of all objects using this material, and change material settings that are stored in the project too.