more enemy stuff
This commit is contained in:
parent
3b60583c76
commit
d8c49317a3
235 changed files with 27781 additions and 3909 deletions
|
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
|
@ -15,6 +16,7 @@ public class AbilityUIObject : MonoBehaviour
|
|||
[SerializeField] private TextMeshProUGUI piercing;
|
||||
[SerializeField] private TextMeshProUGUI projectileCount;
|
||||
[Header("Upgrades")]
|
||||
[SerializeField] private int upgradeSlotAmount;
|
||||
[SerializeField] private UpgradeBoxUI templateUpgradeBox;
|
||||
[SerializeField] private Transform upgradeGrid;
|
||||
[SerializeField] private List<UpgradeBoxUI> upgradeBoxes = new();
|
||||
|
|
@ -32,14 +34,30 @@ public class AbilityUIObject : MonoBehaviour
|
|||
piercing.text = $"Piercing: {isBullet.pierceAmount}";
|
||||
projectileCount.text = $"Projectiles: {isBullet.projectileCount}";
|
||||
}
|
||||
foreach (AbilityUpgrade upgrade in thisAbility.attachedUpgrades)
|
||||
{
|
||||
AddUpgradeBox(upgrade);
|
||||
}
|
||||
|
||||
int upgradeBoxesToAdd = Math.Abs(upgradeSlotAmount - upgradeBoxes.Count);
|
||||
for (int i = 0; i < upgradeBoxesToAdd; i++)
|
||||
{
|
||||
AddUpgradeBox(null);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddUpgradeBox(AbilityUpgrade upgrade)
|
||||
{
|
||||
UpgradeBoxUI newBox = Instantiate(templateUpgradeBox, upgradeGrid);
|
||||
newBox.gameObject.SetActive(true);
|
||||
upgradeBoxes.Add(newBox);
|
||||
newBox.upgradeImage.sprite = upgrade.upgradeIcon;
|
||||
newBox.UpdateCounter();
|
||||
newBox.thisPlayerAbility = thisAbility;
|
||||
if (upgrade)
|
||||
{
|
||||
newBox.upgradeImage.sprite = upgrade.upgradeIcon;
|
||||
newBox.thisAbilityUpgrade = upgrade;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateUpgradeBoxes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue