I’m modifying SkinnedMeshRenderer.sharedMesh.uv of a model to change the vertices trying to animate them. However when I stop the game the changes stay on the model, and starting the game again the changes are still there. How do I prevent this from happening?
Screenshots: Unity UV issues - Album on Imgur
Running the app a second time will offset the texture again.
Code:
SkinnedMeshRenderer meshRend = GetComponent<SkinnedMeshRenderer>();
mesh = meshRend.sharedMesh;
uvs = mesh.uv;
for(int i = 0; i < uvs.Length; i++)
{
uvs <em>= new Vector2(uvs_.x - 0.01f, uvs*.y - 0.01f);*_</em>
}
mesh.uv = uvs;