Skip to main content

WallAlignedDisplay

A class in Root.Township, Alta.Caves.Displays.

Cave chunk display that places objects along walls, facing away from nearby solid cells of a floor plan layer.

Constructors​

MemberWhat it is
WallAlignedDisplay()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

11 private and internal fields
MemberWhat it is
private List<WallAlignedDisplay.Point> checkPointsPrecomputed offsets, directions and weights used to sense walls.
private float checkRadiusRadius in cells to look for walls.
private MapChunkLayer floorThe floor plugin's layer, used to find floor height.
private float floorOffsetHeight offset added to the floor height.
private Plugin floorPlanPlugin whose layer marks solid areas (walls).
private MapChunkLayer floorPlanLayerThis chunk's layer for floorPlan.
private int floorPlanYY slice of the floor plan layer to read.
private float floorThresholdFloor layer value below which a cell counts as open.
private LayerMask hitMaskLayers the wall raycast can hit.
private float minimumDistanceHalf the length of the raycast that must hit a wall; 0 skips the check.
private float thresholdTotal wall weight needed before an object is placed.

Methods​

MemberWhat it is
override void Initialize()Builds the list of check offsets within checkRadius, each weighted by closeness.
protected override IEnumerator RenderInternal() (iterator)Gets the floor plan and floor layers, then spawns at every non-zero cell.
protected override void Spawn(int seed, int spawnSeed, int prefabIndex, int x, int z, float value, ref int index)Sums weighted wall directions around the cell; if above threshold (and the raycast finds a wall), spawns the object facing that way at floor height.