public static void ImportBP(this DysonShell _this, BinaryReader r, DysonSphere dysonSphere) { _this.SetEmpty(); r.ReadInt32(); _this.id = r.ReadInt32(); _this.protoId = r.ReadInt32(); _this.layerId = r.ReadInt32(); _this.randSeed = r.ReadInt32(); int num = r.ReadInt32(); for (int i = 0; i < num; i++) { Vector3 item = default(Vector3); item.x = r.ReadSingle(); item.y = r.ReadSingle(); item.z = r.ReadSingle(); _this.polygon.Add(item); } int num2 = r.ReadInt32(); for (int j = 0; j < num2; j++) { int num3 = r.ReadInt32(); DysonNode dysonNode = dysonSphere.FindNode(_this.layerId, num3); Assert.NotNull(dysonNode); if (dysonNode != null) { _this.nodeIndexMap[num3] = _this.nodes.Count; _this.nodes.Add(dysonNode); if (!dysonNode.shells.Contains(_this)) { dysonNode.shells.Add(_this); } } } Assert.True(_this.nodeIndexMap.Count == _this.nodes.Count); int count = _this.nodes.Count; for (int k = 0; k < count; k++) { int index = k; int index2 = (k + 1) % count; DysonFrame dysonFrame = DysonNode.FrameBetween(_this.nodes[index], _this.nodes[index2]); Assert.NotNull(dysonFrame); _this.frames.Add(dysonFrame); } _this.vertexCount = r.ReadInt32(); _this.triangleCount = r.ReadInt32(); int num4 = r.ReadInt32(); _this.verts = new Vector3[num4]; for (int l = 0; l < num4; l++) { _this.verts[l].x = r.ReadSingle(); _this.verts[l].y = r.ReadSingle(); _this.verts[l].z = r.ReadSingle(); } num4 = r.ReadInt32(); _this.pqArr = new IntVector2[num4]; for (int m = 0; m < num4; m++) { _this.pqArr[m].x = r.ReadInt32(); _this.pqArr[m].y = r.ReadInt32(); } num4 = r.ReadInt32(); _this.tris = new int[num4]; for (int n = 0; n < num4; n++) { _this.tris[n] = r.ReadInt32(); } num4 = r.ReadInt32(); _this.vAdjs = new int[num4]; for (int num5 = 0; num5 < num4; num5++) { _this.vAdjs[num5] = r.ReadInt32(); } num4 = r.ReadInt32(); _this.vertAttr = new int[num4]; for (int num6 = 0; num6 < num4; num6++) { _this.vertAttr[num6] = r.ReadInt32(); } Assert.True(_this.vertAttr.Length == _this.verts.Length); num4 = r.ReadInt32(); _this.vertsq = new int[num4]; for (int num7 = 0; num7 < num4; num7++) { _this.vertsq[num7] = r.ReadInt32(); } Assert.True(_this.vertsq.Length == _this.verts.Length); num4 = r.ReadInt32(); _this.vertsqOffset = new int[num4]; for (int num8 = 0; num8 < num4; num8++) { _this.vertsqOffset[num8] = r.ReadInt32(); } Assert.True(_this.vertsqOffset.Length == _this.nodes.Count + 1); num4 = r.ReadInt32(); _this.nodecps = new int[num4]; Assert.True(_this.nodecps.Length == _this.nodes.Count + 1); num4 = r.ReadInt32(); _this.vertcps = new uint[num4]; num4 = r.ReadInt32(); _this.vertRecycleCursor = r.ReadInt32(); _this.vertRecycle = new int[num4]; for (int num11 = 0; num11 < _this.vertRecycleCursor; num11++) { _this.vertRecycle[num11] = r.ReadInt32(); } Assert.True(_this.vertRecycle.Length == _this.verts.Length); _this.GenerateGeometryOnImport(); }