Skip to main content

Quiver

A class in Root.Township, the global namespace.

Quiver dock that stacks arrows: keeps one real docked arrow and shows extra copies (dummy arrows) for the rest of the stored quantity. Dummies are client only.

Constructors​

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

Fields​

9 private and internal fields
MemberWhat it is
private PickupDock dockPickup dock on this object that stores the arrows.
private Feather dockedFeatherFeather of the first arrow docked, used to build matching dummies.
private List<GameObject> dummyArrowsDummy arrow objects shown in the quiver.
private DummyArrow dummyPrefabPrefab for feathered dummy arrows.
private bool isEmptyTrue when the dock holds no arrows.
private Transform lookAtPointOptional point arrows are angled towards.
private Vector3 maximumVariationLargest random offset from the snap point per axis.
private int maxNumberOfDummyArrowsMost dummy arrows shown.
private float overrideScaleScale arrows get while in the quiver.

Methods​

9 private and internal methods
MemberWhat it is
private void Awake()Hooks the dock's dock and undock events, and quantity changes when not headless.
private void CheckQuantities()Client: adds or removes dummy arrows to match the stored quantity, capped at maxNumberOfDummyArrows.
private Transform CreateDummyArrow()Makes a dummy arrow, from the feathered prefab if the arrow has a feather or by copying the docked arrow's meshes.
private void ItemDocked(Interactor interactor, Pickup arrowPickup, PickupDock dock)Places the docked arrow in the quiver, refreshes dummies and makes it kinematic.
private void ItemUndocked(Interactor interactor, Pickup arrowPickup, PickupDock dock)Restores the arrow's scale and network rigidbody, and updates isEmpty.
private void OnDrawGizmos()Editor: draws the arrow placement box.
private void OnValidate()Editor: re-places the docked and dummy arrows.
private void PlaceArrow(Pickup pickup)Parents an arrow to the snap point at a random offset and spin, pointed at lookAtPoint if set.
private void PlaceArrow(Transform arrow)Parents an arrow to the snap point at a random offset and spin, pointed at lookAtPoint if set.