delurbelako/scripts/structures/debug_item_deposit.gd
2025-10-15 18:18:03 +05:00

15 lines
537 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 _process(_delta: float) -> 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)