GenericCraftingPieceDefinition
A class in Root.Township, Alta.Crafting.
One ghost piece in a generic crafting recipe: where it sits, its mesh, the item that fills it, its build level and how easily it breaks off.
- Listed in Crafting and making
Constructors
| Member | What it is |
|---|---|
GenericCraftingPieceDefinition() | Creates a GenericCraftingPieceDefinition with default values. |
Fields
| Member | What it is |
|---|---|
bool avoidsAtlasing | Whether the piece's renderer skips texture atlasing. |
Mesh collisionMesh | Mesh used for the piece's collider. |
Material defaultMaterial | Material shown before the piece is filled, probably. |
float failureHealth | How much bad nailing the piece takes before it fails. |
int hash | Id of the piece within the recipe. |
bool isCritical | If true, failing this piece may also pop the other pieces of its level. |
int level | Build level. All pieces of a level must be complete before the next level appears. |
PhysicalMaterialChannel materialChannel | Which material channel the piece's renderer uses. |
Mesh mesh | Mesh shown for the piece. |
float minChiselHitDamageToFall | Server: a chisel hit above this knocks the piece off, if it can be removed. |
NailSettings nailSettings | Nails needed to fix the piece in place. |
SerializedTransform position | Where the piece sits on the station. |
int resultHash | Id of the matching part on the finished item, used to copy materials over. |
Item source | The item that fills this piece. |
1 private and internal field
Methods
| Member | What it is |
|---|---|
float GetChanceToPop(float currentFailureHealth) | Chance the piece pops off when a critical piece fails, from how much failure health it has lost. |
GenericCraftingPiece GetNewPiece(IProject project, Transform parent) | Takes a pooled piece, parents it and sets it up for a project. |
Used in
Members of other types that take, return or hold a GenericCraftingPieceDefinition: