unity3d - get the mesh from a cloth and restore it in Unity 5 -


i'm converting unity 4 project unity 5. understand interactivecloth has been changed cloth rendering performance reasons.

in old project, saving mesh of interactivecloth, can restore default state when level starts over

// save mesh netmeshsave = net.mesh;  public void resetnetmesh() {     unityengine.object.destroyobject(net.mesh);     net.mesh = (mesh)mesh.instantiate(netmeshsave);         } 

is there preferred way mesh cloth , restore in unity 5?

i can see cloth.mesh no longer exists in unity 5 api

this best workaround i've found far. restores cloth's mesh default state, not arbitrary saved state:

 public void resetnetmesh()  {     net.getcomponent< skinnedmeshrenderer>().enabled = false;     net.getcomponent< cloth>().enabled = false;     net.getcomponent< cloth>().enabled = true;     net.getcomponent< skinnedmeshrenderer>().enabled = true;  } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -