public static void GenerateMesh(SectionLayer __instance) { if (__instance.GetType().Name != "SectionLayer_Terrain") { return; } Section section = __instance.GetType().GetField("section", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(__instance) as Section; foreach (IntVec3 cell in section.CellRect.Cells) { TerrainDef terrain1 = section.map.terrainGrid.TerrainAt(cell); if (terrain1.defName == "HardVacuum") { Printer_Mesh.PrintMesh(__instance, cell.ToVector3() + new Vector3(0.5f, 0f, 0.5f), MeshMakerPlanes.NewPlaneMesh(1f), RenderPlanetBehindMap.PlanetMaterial); } } }
public override void Print(SectionLayer layer, Thing thing, float extraRotation) { base.Print(layer, thing, extraRotation); var position = thing.Position; for (var i = 0; i < 4; i++) { var c = thing.Position + GenAdj.DiagonalDirectionsAround[i]; if (ShouldLinkWith(c, thing)) { continue; } var unused = thing.DrawPos + (GenAdj.DiagonalDirectionsAround[i].ToVector3().normalized *coverOffsetDist); if (CheckLinkedFourWays(position, thing, i)) { Printer_Mesh.PrintMesh(layer, default, GetCornerMesh(compUVs[i], i), cornerMat);
public override void Print(SectionLayer layer, Thing thing) { base.Print(layer, thing); IntVec3 position = thing.Position; for (int i = 0; i < 4; i++) { IntVec3 c = thing.Position + GenAdj.DiagonalDirectionsAround[i]; if (!this.ShouldLinkWith(c, thing)) { Vector3 center = thing.DrawPos + GenAdj.DiagonalDirectionsAround[i].ToVector3().normalized *this.coverOffsetDist; if (this.CheckLinkedFourWays(position, thing, i)) { Printer_Mesh.PrintMesh(layer, center, this.GetCornerMesh(compUVs[i], i), this.cornerMat); } } } }