Files
ClickRPG/Assets/Scripts/PlayerInventory.cs
2025-10-06 15:32:09 +01:00

28 lines
746 B
C#

using UnityEngine;
public class PlayerInventory : Inventory
{
public static PlayerInventory instance;
private void Awake()
{
instance = this;
}
void Start()
{
// We can update the UI here because this is the Player's inventory
HealthBarUI.instance.UpdateGold(Gold);
}
// 'override' modifies the base AddItem method to add UI updates
public override void AddItem(string itemName)
{
// This calls the base AddItem logic first
base.AddItem(itemName);
// Then, it adds the player-specific UI update
Debug.Log("Updating player UI for item: " + itemName);
// You would add your specific UI update logic here, e.g., UpdateInventoryUI();
}
}