I import a scene from a 3d app and I want to replace some of the materials imported with the scene with materials already developed in Unity after import of a previous scene. Is there a simple way to do it in one go on multiple meshes?
How is the simplest to setup a script to select all the objects with a specified material and swap this material to another one?
I wrote a simple script myself.
var sourceMaterials : Material;
var targetMaterials : Material;
function Start () {
var n = sourceMaterials.length;
for (var i=0; i<n; i++) {
var shader1: Shader = targetMaterials_.shader; sourceMaterials*.shader = shader1;_
sourceMaterials_.CopyPropertiesFromMaterial (targetMaterials);
}
}*_