BuilderDock
A class in Root.Township, Alta.Carpentry.
The dock on a ChisellingDeck where players put wood wedges. Each WedgesPerBlock wedges grows the timber block by one size, and it shows the wedges stacked up.
- Listed in Crafting and making
- Inherits or implements
NetworkEntityBehaviour,IBuildRendererBakeable,IBuildBakeable - Nested types
BoolDelegate - Attributes
RequireComponent - Documented in Farming, woodcutting and carpentry
Constructors
| Member | What it is |
|---|---|
BuilderDock() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|---|
BuilderDock.BoolDelegate ActiveChanged | Delegate called with whether the dock holds any wedges, whenever that changes. |
9 private and internal fields
| Member | What it is |
|---|---|
private float animationDuration | Seconds before docked wedges turn into block size. |
private Transform builderParent | Parent of the wedge pieces, moved along x to follow the block. |
private Renderer[] builderPieces | Renderers for the wedge pieces shown as wedges are added. |
private MeshFilter[] builderPiecesFilters | Mesh filters of the wedge pieces. Not read in this build. |
private ChisellingDeck deck | The chiselling deck this dock feeds. |
private PickupDock dock | The PickupDock on this object. |
private Transform undockingTarget | Where ejected wedges and refuse are dropped. |
private Coroutine updatingRoutine | Private: the running EnsureSpace coroutine. |
private Item wedgeItem | The only item the dock accepts. |
Properties
| Member | What it is |
|---|---|
PhysicalMaterial CurrentPhysicalMaterial { get; private set; } | Material of the wedges in the dock, used for the block and refuse. |
bool IsActive { get; private set; } | Whether the dock currently holds wedges. |
1 private and internal property
Methods
| Member | What it is |
|---|---|
void ReduceSize() | Ejects all wedges and marks the dock inactive. |
void SetupPhysicalMaterial(PhysicalMaterial physicalMaterial) | Sets CurrentPhysicalMaterial directly. |
void SpawnRefuse(int refuse) | Server: spawns wedges of the current material at the undocking point, in a pouch if more than one. |
void UpdatePosition() | Moves the wedge display to the block positioner's BuilderX. |
void UpdateQuantity() | Called when the docked amount changes. The server starts EnsureSpace; clients update visuals. |
7 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the dock filter and quantity change, and empties the dock whenever the block is chiselled. |
private void IBuildRendererBakeable.Bake(bool isSaving) | Hides the wedge pieces when baked. |
private void BlockFilter(Interactor interactor, Pickup pickup, ref bool result) | Private: accepts only the wedge item, matching the block's material, while the deck has space and the block is unchiselled. |
private void IBuildRendererBakeable.Clean() | Does nothing. |
private IEnumerator EnsureSpace() (iterator) | Private, server: updates the visuals and active state, grows the block if there are enough wedges, then makes room on the deck. |
private IEnumerator SpawnAnimation() (iterator) | Private: waits animationDuration, then turns docked wedges into block size, up to the deck's or positioner's limit. Ejects if the block was chiselled. |
private void UpdateImage() | Private: shows wedge pieces in proportion to how many wedges are docked, with the wedges' material. |
Used in
Members of other types that take, return or hold a BuilderDock: