public void UpdateMesh() { if (IsValid) { skeleton.SetColor(color); MeshRendererBuffers.SmartMesh next = meshBuffers.GetNext(); SkeletonRendererInstruction skeletonRendererInstruction = currentInstructions; MeshGenerator.GenerateSingleSubmeshInstruction(skeletonRendererInstruction, skeleton, material); bool flag = SkeletonRendererInstruction.GeometryNotEqual(skeletonRendererInstruction, next.instructionUsed); meshGenerator.Begin(); if (skeletonRendererInstruction.hasActiveClipping) { meshGenerator.AddSubmesh(skeletonRendererInstruction.submeshInstructions.Items[0], flag); } else { meshGenerator.BuildMeshWithArrays(skeletonRendererInstruction, flag); } if (base.canvas != null) { meshGenerator.ScaleVertexData(base.canvas.referencePixelsPerUnit); } if (this.OnPostProcessVertices != null) { this.OnPostProcessVertices(meshGenerator.Buffers); } Mesh mesh = next.mesh; meshGenerator.FillVertexData(mesh); if (flag) { meshGenerator.FillTrianglesSingle(mesh); } base.canvasRenderer.SetMesh(mesh); next.instructionUsed.Set(skeletonRendererInstruction); } }