void MoveMesh(object args) { MoveMeshObj removeObj = (MoveMeshObj)args; // Vertices if (thisAnimationParameters != null) { currentVertices = TreeAnimationController.instance.meshVertices[animationNumber]; } Vector3 firstVert = removeObj.startVert; int minVertPos = 0; for (int i = 0; i < currentVertices.Length; i++) { if (Vector3.Distance(currentVertices[i], firstVert) < 0.01f) { minVertPos = i; break; } } for (int i = 0; i < removeObj.totalVert; i++) { lock (currentVertices) currentVertices[minVertPos + i] += new Vector3(0, 10000, 0); } if (thisAnimationParameters != null) { TreeAnimationController.instance.meshVertices[animationNumber] = currentVertices; } updateCurrentVertices = true; }
public void RemoveMesh(MoveMeshObj moveMesh) { removeList.Add(moveMesh); }