you really gotta calm down, marisa...
This commit is contained in:
parent
13bb58ea03
commit
b9fb490dce
68 changed files with 990 additions and 44 deletions
|
|
@ -1,52 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class AbilityUIObject : MonoBehaviour
|
||||
{
|
||||
[Header("Ability Identification")]
|
||||
[SerializeField] private Image abilityIcon;
|
||||
[SerializeField] private TextMeshProUGUI abilityName;
|
||||
|
||||
[Header("Ability Stats")]
|
||||
[SerializeField] private TextMeshProUGUI damage;
|
||||
[SerializeField] private TextMeshProUGUI fireRate;
|
||||
[SerializeField] private TextMeshProUGUI piercing;
|
||||
[SerializeField] private TextMeshProUGUI projectileCount;
|
||||
[Header("Upgrades")]
|
||||
[SerializeField] private UpgradeBoxUI templateUpgradeBox;
|
||||
[SerializeField] private Transform upgradeGrid;
|
||||
[SerializeField] private List<UpgradeBoxUI> upgradeBoxes = new();
|
||||
|
||||
public PlayerAbility thisAbility;
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
abilityIcon.sprite = thisAbility.abilityIcon;
|
||||
abilityName.text = thisAbility.abilityName;
|
||||
damage.text = $"Damage: {thisAbility.power}";
|
||||
fireRate.text = $"Fire rate: {thisAbility.cooldown}s";
|
||||
if (thisAbility.TryGetComponent(out FireBullet isBullet))
|
||||
{
|
||||
piercing.text = $"Piercing: {isBullet.pierceAmount}";
|
||||
projectileCount.text = $"Projectiles: {isBullet.projectileCount}";
|
||||
}
|
||||
}
|
||||
|
||||
public void AddUpgradeBox(AbilityUpgrade upgrade)
|
||||
{
|
||||
UpgradeBoxUI newBox = Instantiate(templateUpgradeBox, upgradeGrid);
|
||||
upgradeBoxes.Add(newBox);
|
||||
newBox.upgradeImage.sprite = upgrade.upgradeIcon;
|
||||
newBox.UpdateCounter();
|
||||
}
|
||||
|
||||
public void UpdateUpgradeBoxes()
|
||||
{
|
||||
foreach (UpgradeBoxUI box in upgradeBoxes)
|
||||
{
|
||||
box.UpdateCounter();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue