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.
- Listed in Global namespace: Q to R
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
Quiver() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private PickupDock dock | Pickup dock on this object that stores the arrows. |
private Feather dockedFeather | Feather of the first arrow docked, used to build matching dummies. |
private List<GameObject> dummyArrows | Dummy arrow objects shown in the quiver. |
private DummyArrow dummyPrefab | Prefab for feathered dummy arrows. |
private bool isEmpty | True when the dock holds no arrows. |
private Transform lookAtPoint | Optional point arrows are angled towards. |
private Vector3 maximumVariation | Largest random offset from the snap point per axis. |
private int maxNumberOfDummyArrows | Most dummy arrows shown. |
private float overrideScale | Scale arrows get while in the quiver. |
Methods
9 private and internal methods
| Member | What 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. |