15 lines
537 B
GDScript
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)
|