Harvestable

This component allows your prefab to produce something that can then be taken.

Component Harvestable Fields

TypeNameDescription
stringproductwhat prefab the prefab produces
numberproducehow much the prefab holds at the moment
numbergrowtimehow long it takes to produce
numbermaxproducehow much the prefab can hold
functionongrowFires when growing. Args: inst, produce
functiononharvestFires when harvested. Args: inst, picker, produce

Component Harvestable Methods

NameParameterReturnsDescription
SetUpproduct, max, time, onharvest, ongrownilDeclare all variables and set some functions at once!
Grownilnilgrows instantly
StartGrowingtimenilYou can set an initial growtime
StopGrowingnilnilpause growth

Component Harvestable Events

NameDataFires in/when...
harvestsomething (on picker)object (the instance)Harvest (after the function)

Example