Hi there…
I’ve been having some problems with this.
I have a couple of objects which have a material and a texture applied to it within Unity.
I’m replacing, during run-time though scripting, in authoring mode (inside Unity), a couple of material’s main textures from files I’m opening with WWW.
When I press stop, most of the times (I could not learn any pattern to this) the materials do not get their original main texture back. They keep the shader though.
If I press play again, the textures get correctly loaded, so there’s no problem on that part. But, when I press stop, I have to re-apply all the textures to each object in order to work in Unity.
As far as I understand, this would be the intended effect of working with Renderer.sharedMaterial, and not with the Renderer.material.
Any thoughts on how to solve this or what might be happening?
Thanks,
Nicolas.