Skip to main content

ClothManager

A class in Root.Township, the global namespace.

On a player character, kicks the cloth bone rigidbodies against a teleport so cloth doesn't stretch across the jump. Ignores plain repositions.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private Rigidbody[] clothBonesCloth bone rigidbodies to adjust.
private PlayerCharacter playerBacking field for Player.
private float velocityMultiplierScale for the velocity given to the cloth bones.

Properties​

1 private and internal property
MemberWhat it is
private PlayerCharacter Player { get; }The PlayerCharacter on this object, fetched on first use.

Methods​

2 private and internal methods
MemberWhat it is
private void OnEnable()Hooks the character's position-about-to-change event.
private void PlayerAboutToTeleport(PlayerController player, Vector3 oldPosition, Vector3 newPosition, LocomotionFunction function)Sets every cloth bone's velocity to the negative move times velocityMultiplier, unless it's a Reposition.