Files
GodotTutorials/InventoryControllerGD.gd
T
2026-08-29 23:24:04 +01:00

14 lines
417 B
GDScript

extends Control
class_name InventoryControllerGD
@export var inventory : InventoryGD
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
# Obtain all InventorySlot objects and initialize with an index
var inventory_slots = get_tree().get_nodes_in_group("inventory_slots")
for i in inventory_slots.size():
var slot = inventory_slots[i]
slot.initialize_slot(i, inventory)