RecyclerOutputSlot
A class in Root.Township, Alta.Blacksmithing.
One output slot of the recycler. It fills up with molten metal of one material and drops a whole piece of that material into its dock each time it reaches 1.
- Listed in Crafting and making
- Inherits or implements
MonoBehaviour,IDynamicQueueElement<RecyclerOutputSlot>,IBuildRendererPostBake,IBuildBakeable - Derived types
RecyclerOutputSlot - Nested types
SaveData - Documented in Smelting and forging
Constructors
| Member | What it is |
|---|---|
RecyclerOutputSlot() | Creates a RecyclerOutputSlot with default values. |
Fields
16 private and internal fields
| Member | What it is |
|---|---|
private static readonly int _FillProgress | Shader property ID for _FillProgress. |
private static readonly int _NegativeChangeProgress | Shader property ID for _NegativeChangeProgress. |
private static readonly int _PositiveChangeProgress | Shader property ID for _PositiveChangeProgress. |
private Material animatingMaterial | Per-slot copy of the display material whose fill values are animated. |
private float animationContent | Fill amount currently shown by the animation. |
private Coroutine contentAnimation | The running fill animation, if any. |
private float contentAnimationSpeed | Fill animation speed per second. |
private float currentContent | Partial content toward the next whole item, 0 to 1. |
private PickupDock displayDock | Dock holding the display item that shows the material. |
private Renderer[] displayRenderers | Renderers that show the fill bar. |
private Transform filledUpEffectTarget | Where the filled-up effect plays. |
private int index | This slot's index, sent with sync messages. |
private bool isDirectMovement | True when the next sync should animate directly (material change or full sync). |
private TransformEvent onFilledUpEffect | Event played when the slot fills a whole item. |
private MethodSyncStruct<int> syncMethod | Method sync from the recycler, sent with this slot's index when content changes. |
private PickupDock targetDock | Dock finished items are put into. |
Properties
| Member | What it is |
|---|---|
PhysicalMaterial CurrentMaterial { get; private set; } | The material this slot is collecting. |
bool IsEmpty { get; } | True when the partial fill is near zero. Whole pieces in the dock don't count. |
RecyclerOutputSlot Next { get; set; } | Next slot in the recycler's usage order. |
RecyclerOutputSlot Previous { get; set; } | Previous slot in the recycler's usage order. |
float TotalContent { get; } | Partial fill plus the number of whole pieces in the dock. |
Methods
| Member | What it is |
|---|---|
void AddContent(float content) | Server: adds metal, docking a new piece for each whole unit, then syncs and updates the display. |
void Load(RecyclerOutputSlot.SaveData data) | Restores the fill and material from save data. |
void Reappropriate(PhysicalMaterial material) | Switches the slot to a new material: pops out docked pieces, clears the fill and display. |
RecyclerOutputSlot.SaveData Save() | Makes save data with the slot index, fill and material. |
void Serialize(Stream stream, bool isFull) | Reads or writes the fill, and plays the fill animation when reading. |
void Setup(MethodSyncStruct<int> syncMethod, int index) | Gives the slot its sync method and index. On clients, also sets up its fill material. |
void UpdateContentRemote() | Client: animates the fill bar to the current content. |
void UpdateVisual() | Shows a display piece while partly filled, or removes it when empty. |
6 private and internal methods
| Member | What it is |
|---|---|
private void CleanDisplay() | Destroys the display item in the display dock. |
private IEnumerator ContentAnimation() (iterator) | Client coroutine that animates the fill bar to the new content, playing the filled-up effect each time it wraps past full. |
private Pickup NewSource() | Spawns one item of the current material's source item. |
private void OnDestroy() | Cleans up the per-slot material. |
private void IBuildRendererPostBake.PostBake() | Build step that removes missing display renderers. |
private IEnumerator ReappropriationContentAnimation() (iterator) | Client coroutine that animates the fill bar straight up or down to the new content when the material changes. |
Used in
Members of other types that take, return or hold a RecyclerOutputSlot: