Skip to main content

StabilizeLantern

A class in Root.Township, Alta.Inventory.

StabilizeJointContainer for lanterns. In a physical dock it joins the lantern to the dock's root rigidbody and passes grabs through to the root pickup.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private Vector3 baseAnchorJoint anchor saved before docking.
private Vector3 baseConnectedAnchorJoint connected anchor saved before docking.
private Collider[] collidersToKeepOnPhysicalColliders handed to the root pickup while in a physical dock.

Methods​

MemberWhat it is
protected override void Docked(Interactor interactor, Pickup pickup, PickupDock dock)In a physical dock, connects the joint to the root rigidbody, moves the kept colliders to the root pickup and follows its docking.
protected override void Undocked(Interactor interactor, Pickup pickup, PickupDock dock)Undoes Docked: restores the joint anchors and colliders and unhooks the root pickup.
3 private and internal methods
MemberWhat it is
private void DockDocked(Interactor interactor, Pickup pickup, PickupDock dock)When the root pickup is docked, adds it to this pickup's ForwardTo.
private void DockUndocked(Interactor interactor, Pickup pickup, PickupDock dock)When the root pickup is undocked, removes it from ForwardTo.
private void SetCollidersIgnore(Pickup pickupToIgnore, bool isIgnoring)Turns collision on or off between the kept colliders and another pickup's colliders.