Skip to main content

API Reference

Every parameter is a public field on InfiniteCorrugatedRoof, so it can be changed from code. After changing values, call Rebuild() to apply them.

Public methods

MemberDescription
void Rebuild()Regenerates all three LOD meshes from the current settings
bool ShouldUseBakedMesh()true when a baked FBX is assigned and should be shown instead of procedural geometry
bool TryApplyBakedMeshes()Applies the LOD meshes found in bakedFbxAsset; returns false if any LOD mesh is missing
Mesh GetProceduralMesh(int lodIndex)Returns the generated mesh for a given LOD index (0–2)

Example

var roof = GetComponent<InfiniteCorrugatedRoof>();
roof.columnCount = 6;
roof.rowCount = 3;
roof.randomSeed = 42;
roof.corrugationAmplitude = 0.05f;
roof.Rebuild();

Commonly scripted fields

See the Editor Guide for the full list. The fields you'll reach for most from code:

FieldPurpose
columnCount, rowCountGrid size
panelWidth, panelLength, verticalOverlapPanel dimensions & overlap
wavesPerPanel, corrugationAmplitude, waveProfileCorrugation shape
lengthSegmentsPerPanel, sheetThicknessMesh resolution & depth
wearLevel, verticalTiling, verticalOffset, panelColorIndexTexture atlas mapping
randomSeedDeterministic seed for all randomization
Runtime changes need Rebuild()

The automatic live rebuild only runs in Edit Mode. In Play Mode, set your fields and then call roof.Rebuild() once to apply them.


Next: Advanced Features