Hello. I have really strange problem.
As I understand sharedMesh - this is imported mesh.
mesh - this is instantiated mesh from shared mesh.
But why when I’m changing mesh.uv, sharedMesh.uv is Also changes?
Not really. Once you modify MeshFilter.mesh, then you’ve made a new mesh instance, and sharedMesh becomes this new mesh. There can only ever be one mesh referenced by an object…sharedMesh isn’t some kind of “permanent link” to the original mesh or anything.
–Eric
Ok. I got It. When I’m changing .mesh - .meshFilter os also changed for this MeshFilter Component.
So problem is, how to access original mesh UV with out keeping original mesh on stage?
The simplest way would be to make a public variable and reference that.
var originalMesh : Mesh;
function Start () {
var originalUV = originalMesh.uv;
}
–Eric
Yes, this is easiest way. But not the best. I also thought of keeping original mesh on stage. But this is also no very good. Probably I can try to asses original mesh from resources? But how to get resources link? especially if mesh to in the resources folder…
How about just getting a reference to sharedMesh before you change the mesh?
–Eric
This will work good for the first time.
But when I will open scene next time. Shared mesh will be changed. (Script runs in the editor)