Table of Contents

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

parent Transform

Parent transform for roof elements

roomSize Vector3

Room dimensions

wallThickness float

Wall thickness in meters

palette BuildingPalette

Material 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

ridgeHeight float

Height of the ridge peak above the ceiling in meters.

overhang float

How far the roof eaves extend past the walls in meters.

ridgeAlongX bool?

If true, ridge runs along X axis. If false, along Z. Null auto-selects the longer axis.

roofColor Color?

Color for the sloped roof planes.

roofMaterial Material

Material for the sloped roof planes. Null uses fallback color.

baseSlabHeight float

Height 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

preset ParapetPreset

Sizing preset (Deep or Shallow). Overridden by explicit dimensions.

parapetHeight float?

Height of the parapet wall in meters. Null uses preset default.

parapetDepth float?

Depth of the parapet wall. Null uses wall thickness + padding.

capHeight float?

Height of the cap on top of the parapet. Null uses preset default.

capOverhang float?

How far the cap extends past the parapet wall on each side. Null uses preset default.

parapetColor Color?

Color override for the parapet wall.

parapetMaterial Material

Material override for the parapet wall.

capColor Color?

Color override for the cap.

capMaterial Material

Material override for the cap.

Returns

GameObject

The roof container GameObject.