- Home /
Question by
bubblegumsoldier · Jun 13, 2012 at 10:27 PM ·
materialcolorinstance
material instance save
HI, I've got a script in which the color of the material changes. But when I load a new scene or restart a scene, the material is standart again. So I watched the Inspector while changing the color and I saw there was Nameofmaterial (Instance). So is there a way to save the color of the material?
var selectedColor :Color;
this.renderer.material.SetColor("_SpecColor", selectedColor);
This code doesn't save the color of the material... please help me fast!
Comment
I'd have to know how you're setting the "selectedColor" variable. I assume it's the inspector, so just save selectedColor
as a static
variable and assign it in the inspector.
If you want change the asset: renderer.shared$$anonymous$$aterial.setColor() may useful.