MouldPress
A class in Root.Township, the global namespace.
Lever-driven press that stamps a pattern item into a blank mould. The press moves on every side; only the server applies the pattern.
- Listed in Global namespace: M to O
- Inherits or implements
NetworkEntityBehaviour
Constructors
| Member | What it is |
|---|---|
MouldPress() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private float addMaxThreshold | Lever value below which a pattern item can be docked. |
private float downHeight | Local Y of the press head when fully down. |
private Transform invalidPress | Where the pattern item is undocked to when the mould already has a definition. |
private Lever lever | Lever that drives the press. |
private PickupDock mouldOutputDock | Dock holding the mould. |
private Transform press | Press head transform that moves with the lever. |
private AnimationCurve pressCurve | Curve from lever value to press position. |
private AltaEvent pressed | Event fired after the server applies a pattern. |
private float pressMinThreshold | Lever value above which the press applies the pattern. |
private float upHeight | Local Y of the press head when fully up. |
private PickupDock weaponPartDock | Dock holding the pattern item. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Adds a filter to the weapon part dock. |
void SetMould(PickupDock input, PickupDock output) | Sets a blank mould's definition from the docked pattern item and destroys the item; if the mould already has one, undocks the item instead. |
3 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the lever's value change. |
private void InputFilter(Interactor interactor, Pickup pickup, ref bool result) | Only lets an item dock in the weapon part dock while the lever is below addMaxThreshold. |
private void ValueChanged(Lever lever, float oldValue, float newValue) | Moves the press head with the lever; server: past pressMinThreshold with both docks filled, calls SetMould and fires pressed. |