Skip to main content

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.

Constructors​

MemberWhat it is
GenericCraftingPieceDefinition()Creates a GenericCraftingPieceDefinition with default values.

Fields​

MemberWhat it is
bool avoidsAtlasingWhether the piece's renderer skips texture atlasing.
Mesh collisionMeshMesh used for the piece's collider.
Material defaultMaterialMaterial shown before the piece is filled, probably.
float failureHealthHow much bad nailing the piece takes before it fails.
int hashId of the piece within the recipe.
bool isCriticalIf true, failing this piece may also pop the other pieces of its level.
int levelBuild level. All pieces of a level must be complete before the next level appears.
PhysicalMaterialChannel materialChannelWhich material channel the piece's renderer uses.
Mesh meshMesh shown for the piece.
float minChiselHitDamageToFallServer: a chisel hit above this knocks the piece off, if it can be removed.
NailSettings nailSettingsNails needed to fix the piece in place.
SerializedTransform positionWhere the piece sits on the station.
int resultHashId of the matching part on the finished item, used to copy materials over.
Item sourceThe item that fills this piece.
1 private and internal field
MemberWhat it is
private AnimationCurve chanceToPopBasedOnFailureHealthRatioCurve from lost failure health (0 to 1) to the chance the piece pops off; used by GetChanceToPop.

Methods​

MemberWhat 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: