Class RoofBuilder
- Namespace
- S1MAPI.Building.Structural
- Assembly
- S1MAPI_Mono.dll
Creates roof structures including parapet walls and hip roofs. Extracted from DecorBuilder for SRP compliance.
public sealed class RoofBuilder
- Inheritance
-
RoofBuilder
- Inherited Members
Constructors
RoofBuilder(Transform, Vector3, float, BuildingPalette)
Create a new roof builder.
public RoofBuilder(Transform parent, Vector3 roomSize, float wallThickness, BuildingPalette palette)
Parameters
parentTransformParent transform for roof elements
roomSizeVector3Room dimensions
wallThicknessfloatWall thickness in meters
paletteBuildingPaletteMaterial and color palette
Methods
AddHipRoof(float, float, bool?, Color?, Material?, float)
Add a hip (four-slope) roof using custom mesh geometry. All four sides slope inward to a central ridge that is shorter than the building length. For square buildings, the ridge collapses to a point (pyramid roof). A base slab sits at ceiling height and the slopes start from the top of the slab, giving the roof visible thickness when viewed from below. For interior ceilings, use AddCeiling() separately — the ceiling sits just below the roof slab with no overlap.
public GameObject AddHipRoof(float ridgeHeight = 2, float overhang = 0.3, bool? ridgeAlongX = null, Color? roofColor = null, Material? roofMaterial = null, float baseSlabHeight = 0.15)
Parameters
ridgeHeightfloatHeight of the ridge peak above the ceiling in meters.
overhangfloatHow far the roof eaves extend past the walls in meters.
ridgeAlongXbool?If true, ridge runs along X axis. If false, along Z. Null auto-selects the longer axis.
roofColorColor?Color for the sloped roof planes.
roofMaterialMaterialMaterial for the sloped roof planes. Null uses fallback color.
baseSlabHeightfloatHeight of the 3D base slab beneath the slopes. 0 disables the slab.
Returns
- GameObject
The roof container GameObject.
AddParapetRoof(ParapetPreset, float?, float?, float?, float?, Color?, Material?, Color?, Material?)
Add a parapet roof (raised wall and cap above the roofline). The cap extends past the parapet wall by the overhang amount, creating a ledge. Includes a thin roof slab at ceiling height. For interior ceilings, use AddCeiling() separately — the ceiling sits just below the roof slab with no overlap.
public GameObject AddParapetRoof(ParapetPreset preset = ParapetPreset.Deep, float? parapetHeight = null, float? parapetDepth = null, float? capHeight = null, float? capOverhang = null, Color? parapetColor = null, Material? parapetMaterial = null, Color? capColor = null, Material? capMaterial = null)
Parameters
presetParapetPresetSizing preset (Deep or Shallow). Overridden by explicit dimensions.
parapetHeightfloat?Height of the parapet wall in meters. Null uses preset default.
parapetDepthfloat?Depth of the parapet wall. Null uses wall thickness + padding.
capHeightfloat?Height of the cap on top of the parapet. Null uses preset default.
capOverhangfloat?How far the cap extends past the parapet wall on each side. Null uses preset default.
parapetColorColor?Color override for the parapet wall.
parapetMaterialMaterialMaterial override for the parapet wall.
capColorColor?Color override for the cap.
capMaterialMaterialMaterial override for the cap.
Returns
- GameObject
The roof container GameObject.