slipster216 / VertexPaint

Unity 5.3 Vertex Painter
Other
906 stars 151 forks source link

Removing component VertexInstanceStream do not remove additionnal mesh data #2

Closed apautrot closed 8 years ago

apautrot commented 8 years ago

When removing the component VertexInstanceStream, the change on MeshRenderer is not reverted. To fix this, you could add this code to the VertexInstanceStream component :

void OnDestroy ()
{
       if ( ! Application.isPlaying )
       {
           MeshRenderer mr = GetComponent<MeshRenderer> ();
           if ( mr != null )
               mr.additionalVertexStreams = null;
       }
}
slipster216 commented 8 years ago

fixed, thanks!