//----------------------------------------------------------------------------------- private void UpdateVertexBody( Transform tr, BodyInfo bdInfo ) { SoftBodyInfo softInfo = (SoftBodyInfo)bdInfo; tr.localPosition = softInfo.center_; tr.localRotation = Quaternion.identity; tr.localScale = Vector3.one; GameObject go = tr.gameObject; Caronte_Fx_Body cfxBody = go.GetComponent<Caronte_Fx_Body>(); if (cfxBody != null && eManager_.HasBodyMeshColliderRef(bdInfo.idBody_) ) { UnityEngine.Mesh meshCollider = eManager_.GetBodyMeshColliderRef(bdInfo.idBody_); if (meshCollider != null) { meshCollider.vertices = softInfo.arrVerticesCollider_; meshCollider.RecalculateNormals(); meshCollider.RecalculateBounds(); cfxBody.SetCustomColliderMesh(meshCollider); } } Tuple2<UnityEngine.Mesh, MeshUpdater> meshRenderData = eManager_.GetBodyMeshRenderUpdaterRef(bdInfo.idBody_); UnityEngine.Mesh meshToUpdate = meshRenderData.First; MeshUpdater meshUpdater = meshRenderData.Second; meshToUpdate.vertices = softInfo.arrVerticesRender_; mcForUpdates.Clear(); mcForUpdates.Set(meshToUpdate, null); CaronteSharp.Tools.UpdateVertexNormalsAndTangents( meshUpdater, mcForUpdates ); meshToUpdate.normals = mcForUpdates.arrNormal_; meshToUpdate.tangents = mcForUpdates.arrTan_; meshToUpdate.RecalculateBounds(); }