A class in Root.Township, the global namespace.
A pickup with jointed child rigidbodies that freezes them and snaps them back to their starting local poses while it is docked.
Constructors
| Member | What it is |
|---|
DockableJoints() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private int bodiesCount | Number of entries in jointedBodies, cached in Awake. |
private Rigidbody[] jointedBodies | The child rigidbodies to freeze while docked. |
private TransformSave[] saves | Local transform of each jointed body as recorded in Awake. |
Methods
| Member | What it is |
|---|
protected override void Awake() | Hooks the dock and undock events and records each jointed body's local transform. |
2 private and internal methods
| Member | What it is |
|---|
private void OnDocked(Interactor interactor, Pickup pickup, PickupDock dock) | Makes every jointed body kinematic and restores its saved local transform. |
private void OnUndocked(Interactor interactor, Pickup pickup, PickupDock dock) | Makes the jointed bodies non-kinematic again so the joints move freely. |