Pinboard
A class in Root.Township, Alta.Pages.
Server: a board pages can be pinned to by dropping them in its pickup area. Looks unfinished: AddPage never counts pages and always returns false, so dropped pages are re-parented but never removed.
- Listed in Items, inventory and logic
- Inherits or implements
NetworkEntityBehaviour - Documented in Pages and books
Constructors
| Member | What it is |
|---|---|
Pinboard() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private TextRenderer countText | Text for the page count; not used here. |
private float height | Board height, for the gizmo. |
private List<Pickup> hovering | Pickups in the area being watched. |
private int maximum | Most pages the board takes (10); not serialized. |
private TextRenderer maximumText | Text for the maximum; not used here. |
private List<PageInstance> pages | Pinned pages; nothing adds to it. |
private PickupArea pickupArea | Area that detects pages held over the board. |
private GameObject pinAsset | Pin object spawned for each pinned page. |
private Vector2 pinOffset | Offset of the pin from the page position. |
private List<GameObject> pins | Pin objects spawned. |
private float width | Board width, for the gizmo. |
Methods
| Member | What it is |
|---|---|
override void InitializeAsServer(SpawnData spawnData) | Server: hooks the pickup area's added and removed events. |
7 private and internal methods
| Member | What it is |
|---|---|
private bool AddPage(PageInstance page) | Parents the page to the board at its drop spot and adds a pin, unless full. Always returns false and never adds to pages. |
private void CheckInsert(Interactable pickup, Interactor interactor) | When a hovering page is let go, tries AddPage and destroys the page entity if it returns true. |
private void ListenForPageDrop(Pickup pickup) | Starts watching a pickup that entered the area for being let go. |
private void OnDrawGizmosSelected() | Editor: draws the board's area as a cyan box. |
private void StartListeningForDrops() | Turns the pickup area on; not called here. |
private void StopListenForPageDrop(Pickup pickup) | Stops watching a pickup that left the area. |
private void StopListeningForDrops() | Turns the pickup area off and stops watching all pickups; not called here. |