- Home /
Question by
Lemo76 · Dec 16, 2013 at 09:01 PM ·
transparent-texture
Unity Assign Texture to Material in All Scenes (JS)
So I have a material applied to a wall in all scenes which has no texture but is transparent.
How do I code a Javascript script which will enable me to change the texture of not the wall object (with that material) e.g.
var Mat : Material;
var texture : Texture;
function OnMouseDown () {
Mat.renderer.material.mainTexture = texture;
}
but also to the actual material in the Project View so that all of the walls in all the scenes will have a different texture, not just one scene?
1.png
(66.3 kB)
Comment
Your answer
Follow this Question
Related Questions
Problems with Textures 2 Answers
Unity ignores textures inside transparent objects. Need help! 2 Answers
How to size a texture for a object New to unity. Please Help 0 Answers
Messy normals with Transparent material 0 Answers
Unity repeats my texture over each individual face of an object? 2 Answers