using System; using System.Collections.Generic; namespace ProBuilder2.Common { // Token: 0x0200004E RID: 78 public class pb_FaceRebuildData { // Token: 0x0600025F RID: 607 RVA: 0x0001F0D7 File Offset: 0x0001D4D7 public int Offset() { return this._appliedOffset; } // Token: 0x06000260 RID: 608 RVA: 0x0001F0DF File Offset: 0x0001D4DF public override string ToString() { return string.Format("{0}\n{1}", this.vertices.ToString(", "), this.sharedIndices.ToString(", ")); } // Token: 0x06000261 RID: 609 RVA: 0x0001F10C File Offset: 0x0001D50C public static void Apply(IEnumerable newFaces, pb_Object pb, List vertices = null, List faces = null, Dictionary lookup = null, Dictionary lookupUV = null) { List list = ((faces != null) ? faces : new List(pb.faces)); if (vertices == null) { vertices = new List(pb_Vertex.GetVertices(pb, null)); } if (lookup == null) { lookup = pb.sharedIndices.ToDictionary(); } if (lookupUV == null) { lookupUV = ((pb.sharedIndicesUV == null) ? null : pb.sharedIndicesUV.ToDictionary()); } pb_FaceRebuildData.Apply(newFaces, vertices, list, lookup, lookupUV); pb.SetVertices(vertices, false); pb.SetFaces(list.ToArray()); pb.SetSharedIndices(lookup); pb.SetSharedIndicesUV(lookupUV); } // Token: 0x06000262 RID: 610 RVA: 0x0001F1B0 File Offset: 0x0001D5B0 public static void Apply(IEnumerable newFaces, List vertices, List faces, Dictionary sharedIndices, Dictionary sharedIndicesUV = null) { int num = vertices.Count; foreach (pb_FaceRebuildData pb_FaceRebuildData in newFaces) { pb_Face pb_Face = pb_FaceRebuildData.face; int count = pb_FaceRebuildData.vertices.Count; bool flag = sharedIndices != null && pb_FaceRebuildData.sharedIndices != null && pb_FaceRebuildData.sharedIndices.Count == count; bool flag2 = sharedIndicesUV != null && pb_FaceRebuildData.sharedIndicesUV != null && pb_FaceRebuildData.sharedIndicesUV.Count == count; for (int i = 0; i < count; i++) { int num2 = i; if (sharedIndices != null) { sharedIndices.Add(num2 + num, (!flag) ? (-1) : pb_FaceRebuildData.sharedIndices[num2]); } if (sharedIndicesUV != null) { sharedIndicesUV.Add(num2 + num, (!flag2) ? (-1) : pb_FaceRebuildData.sharedIndicesUV[num2]); } } pb_FaceRebuildData._appliedOffset = num; for (int j = 0; j < pb_Face.indices.Length; j++) { pb_Face.indices[j] += num; } pb_Face.RebuildCaches(); num += pb_FaceRebuildData.vertices.Count; faces.Add(pb_Face); vertices.AddRange(pb_FaceRebuildData.vertices); } } // Token: 0x040001B5 RID: 437 public pb_Face face; // Token: 0x040001B6 RID: 438 public List vertices; // Token: 0x040001B7 RID: 439 public List sharedIndices; // Token: 0x040001B8 RID: 440 public List sharedIndicesUV; // Token: 0x040001B9 RID: 441 private int _appliedOffset; } }