Skip to main content

DisposablePickupHolder

A class in Root.Township, the global namespace.

Holds a child pickup (from a buildup slot) that the player can pull out with a PullPickup. When disposed, it lets the child go into the world or into the pulling hand.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Pickup basePickupThe pickup the holder is part of; it must be held to pull.
private Pickup heldPickupThe pickup being held.
private PullPickup pullPickupPull handle that hands the held pickup over.
private MethodSync syncHeldUnused.

Properties​

1 private and internal property
MemberWhat it is
private bool IDisposablePickup.IsDisposed { get; }Always false.

Methods​

MemberWhat it is
void Dispose(bool isForced)Turns off the pull pickup and frees the held pickup into the pulling hand or the world, fixing its save mode.
5 private and internal methods
MemberWhat it is
private void BaseFilter(Interactor interactor, Interactable interactable, ref bool result)Only allows pulling by the player who is holding the base pickup.
private void DestroyDispose(NetworkEntity entity, bool isUnload)Disposes when the held pickup is destroyed by the scene (not unloaded).
private void IGetChild.LoseChild(NetworkEntity child)Empty.
private void IGetChild.RegisterChild(NetworkEntity child)Takes the child as the held pickup and points the pull pickup at it.
private void Start()Hooks the base filter and the held pickup's destroy, and turns the pull pickup on only if something is held.