Reorganize project into folder structure

This commit is contained in:
JonShard
2026-07-16 15:09:12 +02:00
parent 4b8e017d64
commit e27ddfe3f1
33 changed files with 156 additions and 70 deletions
+22
View File
@@ -0,0 +1,22 @@
extends StaticBody3D
@export var item_scene : PackedScene
@onready var snap_zone: XRToolsSnapZone = $XRToolsSnapZone
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if not item_scene:
push_error("Item dispenser is missing a reference to it's item to dispense")
if not snap_zone:
push_error("Item dispenser is missing a reference to its snap zone child")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if not snap_zone.picked_up_object:
var new_item = item_scene.instantiate()
# Add the new item to the hob's parent (so it lives in the main world space)
get_parent().add_child(new_item)
new_item.global_transform = snap_zone.transform
snap_zone.pick_up_object(new_item)