Skip to main content

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.

Constructors​

MemberWhat it is
RecyclerOutputSlot()Creates a RecyclerOutputSlot with default values.

Fields​

16 private and internal fields
MemberWhat it is
private static readonly int _FillProgressShader property ID for _FillProgress.
private static readonly int _NegativeChangeProgressShader property ID for _NegativeChangeProgress.
private static readonly int _PositiveChangeProgressShader property ID for _PositiveChangeProgress.
private Material animatingMaterialPer-slot copy of the display material whose fill values are animated.
private float animationContentFill amount currently shown by the animation.
private Coroutine contentAnimationThe running fill animation, if any.
private float contentAnimationSpeedFill animation speed per second.
private float currentContentPartial content toward the next whole item, 0 to 1.
private PickupDock displayDockDock holding the display item that shows the material.
private Renderer[] displayRenderersRenderers that show the fill bar.
private Transform filledUpEffectTargetWhere the filled-up effect plays.
private int indexThis slot's index, sent with sync messages.
private bool isDirectMovementTrue when the next sync should animate directly (material change or full sync).
private TransformEvent onFilledUpEffectEvent played when the slot fills a whole item.
private MethodSyncStruct<int> syncMethodMethod sync from the recycler, sent with this slot's index when content changes.
private PickupDock targetDockDock finished items are put into.

Properties​

MemberWhat 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​

MemberWhat 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
MemberWhat 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: