mirror of
https://github.com/omegaleo/Tutorials.git
synced 2026-11-08 17:43:27 +00:00
14 lines
417 B
GDScript
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)
|