Refactor character attributes system; replace individual attributes with a dictionary-based approach for better scalability and maintainability
This commit is contained in:
@@ -3,6 +3,7 @@ using Systems;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Attribute = Data.Attribute;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
@@ -18,11 +19,11 @@ namespace UI
|
||||
var player = GameManager.Instance.Player;
|
||||
if (!player) return;
|
||||
|
||||
expText.text = $"EXP: {player.attributes.Experience}";
|
||||
expText.text = $"EXP: {player.attributes.Get(Attribute.Experience)}";
|
||||
coinsText.text = $"Coins: {GameManager.Instance.Coins}";
|
||||
roundTimeLeftText.text = $"{GameManager.Instance.RoundTimeLeft:F1}s";
|
||||
healthSlider.maxValue = player.attributes.MaxHealth;
|
||||
healthSlider.value = player.attributes.Health;
|
||||
healthSlider.maxValue = player.attributes.Get(Attribute.MaxHealth);
|
||||
healthSlider.value = player.attributes.Get(Attribute.Health);
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,11 +5,13 @@ using KBCore.Refs;
|
||||
using Shop;
|
||||
using Systems;
|
||||
using UnityEngine;
|
||||
using Attribute = Data.Attribute;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class LevelUpHud : MonoBehaviour
|
||||
{
|
||||
private float previousLevel = 1f;
|
||||
private List<UpgradeSlot> currentSlots = new();
|
||||
private List<StatModifierItem> currentItemChoices = new();
|
||||
private List<WeaponItem> currentWeaponChoices = new();
|
||||
|
Reference in New Issue
Block a user