private void DeformMeshAndContinue(Transform meshTransform, Vector3 rootPosition) { if (meshTransform == null) { return; } var meshFilter = meshTransform.GetComponent <MeshFilter>(); if (meshFilter != null) { if (!sharedMeshStore.ContainsKey(meshFilter)) { sharedMeshStore.Add(meshFilter, meshFilter.sharedMesh.vertices); } var job = new DeformJob(center.Value, sharedMeshStore[meshFilter], meshTransform, rootPosition); handles.Add(new JobHandleMesh(job.Schedule(), job, meshFilter)); } for (int i = 0; i < meshTransform.childCount; i++) { DeformMeshAndContinue(meshTransform.GetChild(i), rootPosition); } }
public JobHandleMesh(JobHandle handle, DeformJob job, MeshFilter meshFilter) { this.handle = handle; this.job = job; this.meshFilter = meshFilter; }