mirror of
https://github.com/omegaleo/Tutorials.git
synced 2026-11-09 01:53:29 +00:00
Added Inventory System
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Godot;
|
||||
|
||||
public partial class InventoryController : Control
|
||||
{
|
||||
[Export] public Inventory Inventory;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
var inventorySlots = GetTree().GetNodesInGroup("inventory_slots_cs");
|
||||
|
||||
for (int i = 0; i < inventorySlots.Count; i++)
|
||||
{
|
||||
var slot = (InventorySlot)inventorySlots[i];
|
||||
|
||||
slot.InitializeSlot(i, Inventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user