alotta upgrade stuff but no upgrades
This commit is contained in:
parent
b9fb490dce
commit
3b60583c76
35 changed files with 2937 additions and 61 deletions
|
|
@ -4,10 +4,29 @@ using UnityEngine;
|
|||
|
||||
public class AbilityUIHandler : MonoBehaviour
|
||||
{
|
||||
public List<AbilityUIObject> uiObjects = new();
|
||||
#region Statication
|
||||
|
||||
public static AbilityUIHandler instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
}
|
||||
|
||||
#endregion
|
||||
[Header("Abilities")]
|
||||
public List<AbilityUIObject> uiObjects = new();
|
||||
[SerializeField] private MarisaAbilityHandler playerAbilityHandler;
|
||||
|
||||
[Header("Upgrades")]
|
||||
[SerializeField] private Transform upgradeGrid;
|
||||
[SerializeField] private StoredAbilityUpgradeUI templateStoredUpgradeUI;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
uiObjects[0].thisAbility = playerAbilityHandler.mainAttackInstance;
|
||||
|
|
@ -19,4 +38,17 @@ public class AbilityUIHandler : MonoBehaviour
|
|||
uiObject.UpdateUI();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateInventory()
|
||||
{
|
||||
foreach (Transform child in upgradeGrid) //awful but we'll go with it for now
|
||||
{
|
||||
Destroy(child.gameObject);
|
||||
}
|
||||
foreach (AbilityManager.StoredUpgrade storedUpgrade in AbilityManager.instance.upgradesInventory)
|
||||
{
|
||||
StoredAbilityUpgradeUI newUI = Instantiate(templateStoredUpgradeUI, upgradeGrid);
|
||||
newUI.SetUpgrade(storedUpgrade.upgrade, storedUpgrade.count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue