Get a material at index on a gameObject and store it in a variable
The Game Object that the material is applied to.
The index of the material to get.
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.