- Home /
Combine materials out of renderer.materials
Hey,
If I have a mesh renderer with several materials in it. Then I can access those materials with renderer.materials.
So if I would no change it so that renderer.materials[1] = renderer.materials[2], then they would use the same material. So now I have twice the same material. So can I now combine them so that they are displayed as one material? so that I don't need to change materials[1] and materials[2] each time but only one material. As far as I see it that would also improve performance as I have fewer materials that I use. But I couldn't find any way to do that yet.
Answer by Jeff-Kesselman · May 22, 2014 at 02:58 PM
No, you can't.
They are separate variables. You need to set them separately.
The only way to make them all change with one action is to change the settings of the Material itself.
Your answer
Follow this Question
Related Questions
Changing two different objects renderer colour 1 Answer
Emissive Material control via script (code) 1 Answer
How to check whether a lot of components and their children have a mesh renderer on them in code? 1 Answer
Issue with Mesh Renderer and Skinned Mesh Renderer 0 Answers
How to compare 2 materials? 2 Answers