- Home /
How to change object's material while preserving material's color?
So here's the thing: In my level editor you can make "invisible" objects as to e.g. create invisible wall, or put invisible ramp over set of stairs.
Obviously making them actually not rendered in the editor would cause frustration, so I've figured out next best thing: Objects would go into wireframe when "invisibility" box is checked (or rather, in my case "rendered?" box is unchecked).
However, the thing is, user can change object's color (almost) at will and setting new material would make reset color to material's default color.
The obvious choice would be just to set again object's color after material switch, however I can't but wonder if there's more elegant way of doing this, such as e.g. switching just shader the model is using. Any ideas?
Have you tried switching the shader?
http://docs.unity3d.com/ScriptReference/$$anonymous$$aterial-shader.html
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
Changing two different objects renderer colour 1 Answer
How do I get the current alpha value of a material? 2 Answers
Lights colored like material 0 Answers
Cannot change material colour 2 Answers