StructureCube
A class in Root.Township, the global namespace.
One grid cell of a StructurePart used by the mining base generator. Its side flags say where it connects and what must be next to it.
- Listed in Global namespace: S
- Inherits or implements
MonoBehaviour,IIgnoreForStaticFlatten,IDontSplit
Constructors
| Member | What it is |
|---|---|
StructureCube() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private StructureSide air | Sides of this cell that are open air for neighbours. |
private StructureSide connectToAir | Sides that must face an air side of a neighbouring part for the part to be placed. |
private StructureSide connectToSolid | Sides that must face a solid side of a neighbouring part for the part to be placed. |
private StructureSide gates | Sides with an opening that a path can pass through; the mine generator links gates between parts. |
private int minimumGatesForCulling | If above 0, the mine generator drops the part when fewer than this many of the cell's gates line up with incoming gates. |
private StructurePart part | Parent structure part, found on first gizmo draw. |
private StructureSide solid | Sides of this cell that are solid for neighbours. |
private int x | Cell X position in the part's grid. |
private int y | Cell Y position in the part's grid. |
private int z | Cell Z position in the part's grid. |
Properties
| Member | What it is |
|---|---|
StructureSide Air { get; } | Sides that are open air. |
StructureSide ConnectToAir { get; } | Sides that need air next to them. |
StructureSide ConnectToSolid { get; } | Sides that need something solid next to them. |
StructureSide Gates { get; } | Sides that are openings other parts can connect to. |
int MinimumGatesForCulling { get; } | If above 0, a placed part is dropped when fewer than this many of the cube's gates connect. |
StructureSide Solid { get; } | Sides that are solid. |
int X { get; } | Cell X position in the part's grid. |
int Y { get; } | Cell Y position in the part's grid. |
int Z { get; } | Cell Z position in the part's grid. |
Methods
| Member | What it is |
|---|---|
void LoadFrom(StructurePart.Cube cube) | Copies position and side flags from a StructurePart.Cube. |
2 private and internal methods
| Member | What it is |
|---|---|
private void DrawSides(Color color, Vector3 size, Vector3 position, StructureSide sides) | Editor: draws a thin coloured box on each side set in the given flags. |
private void OnDrawGizmosSelected() | Editor: draws the cell and its gate, solid, air and connection sides inside the parent structure part. |
Used in
Members of other types that take, return or hold a StructureCube: