Skip to main content

PickupExtension

A class in Root.Township, the global namespace.

An interactable that passes grabs on to another interactable, such as an extra handle on a larger pickup. It can refuse while the target is held, or held by the same player.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private PickupExtension.Allowance allowanceRule for when to refuse: never, when the same player holds the target, or whenever the target is held.
private Interactable targetInteractableThe interactable grabs are passed to.

Methods​

MemberWhat it is
override bool AssessInteraction(Interactor interactor, out float score)Refuses the interaction when the allowance rule blocks it, otherwise scores it as usual.
override Interactable CheckForward(Interactor interactor, out bool isForced)Returns targetInteractable so the grab goes there, or null when the allowance rule blocks it.
1 private and internal method
MemberWhat it is
private void SwapInteract(Interactor interactor, Interactable interactable)Swaps the interactor over to targetInteractable. Not called in this class.