TowerGame/scripts/buildings/storage.gd

11 lines
252 B
GDScript

extends Building
var held_item: Item = null
func _process(delta: float) -> void:
if !producer.consumers.is_empty():
held_item = consumer.take_any_item_from_storage()
if held_item != null and producer.send_item(held_item):
held_item = null