override protected void Awake(){
base.Awake();
material = null;
}
//This will make it create a new instance next time mainTexture is set for the duplicated object
[mainTexture...]
if (mMat == null)
{
mDynamicMat
= new Material
(shader
); mDynamicMat.hideFlags = HideFlags.DontSave;
mMat = mDynamicMat;
}
[...]