Skip to main content

CosmeticBodyType

A class in Root.Township, Alta.Customization.

Customization part that sets the character's body type: animator body shape plus belt dock and stat bar spacing. Client-side visuals, part of a body type cosmetic definition.

Constructors​

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

Fields​

MemberWhat it is
static readonly int BodyTypeHash of the animator integer parameter BodyType.
5 private and internal fields
MemberWhat it is
private int bodyTypeIndexBacking field for BodyTypeIndex.
private bool isMasculineBacking field for IsMasculine.
private float pouchBeltDocksDistanceRatioBacking field for PouchBeltDocksDistanceRatio.
private float statbarsDistanceRatioScale for how far the stat bars sit from the body; applied in Attach, no public getter.
private float toolBeltDocksDistanceRatioBacking field for ToolBeltDocksDistanceRatio.

Properties​

MemberWhat it is
int BodyTypeIndex { get; }Index of this body type (0 to 7). Even indices are feminine shapes, odd are masculine, going small, medium, buff, large.
bool IsMasculine { get; }Whether this is a masculine body type. CosmeticHairPart uses it to pick the chance of rolling no hair.
float PouchBeltDocksDistanceRatio { get; }Scale for how far the pouch belt docks sit from the body.
float ToolBeltDocksDistanceRatio { get; }Scale for how far the tool belt docks sit from the body.

Methods​

MemberWhat it is
static void ApplyToAnimator(Animator animator, int bodyTypeIndex)Sets the animator's BodyType integer, jumps it to the matching state (F_small, M_small and so on up to index 7) and updates it once.
protected override void Attach(ICustomizationHandler handler, CustomizationArguments arguments)Applies the body type to the handler's character dummy: animator integer, tool belt, pouch belt and stat bar distance ratios, and the cosmetic packer's body type index.
protected override void ChangeArguments(ICustomizationHandler handler, CustomizationArguments arguments)Does nothing; body types take no arguments.
protected override void Detach(ICustomizationHandler handler)Does nothing; the next body type overwrites the values.