delurbelako/scripts/structures/debug_item_deposit.gd
2025-10-17 18:22:49 +05:00

15 lines
539 B
GDScript

extends StructureBehaviour
const inp1 := preload("res://generic/items/dbg_input1.tres")
const inp2 := preload("res://generic/items/dbg_input2.tres")
const out := preload("res://generic/items/dbg_output.tres")
func _tick(_current_tick: int) -> void:
try_add(Vector2.UP,Stack.new(inp1,1))
try_add(Vector2.DOWN,Stack.new(inp2,1))
try_add(Vector2.RIGHT,Stack.new(out,1))
func try_add(dir: Vector2,stack : Stack):
var found = structure_parent.get_relative(dir)
if found != null and found.inventory != null:
found.inventory.add(stack)