alotta upgrade stuff but no upgrades
This commit is contained in:
parent
b9fb490dce
commit
3b60583c76
35 changed files with 2937 additions and 61 deletions
|
|
@ -31,10 +31,33 @@ public class AbilityManager : MonoBehaviour
|
|||
public Button upgradeButton;
|
||||
|
||||
[Header("Upgrades")]
|
||||
public List<StoredUpgrade> upgradesInventory;
|
||||
public HashSet<StoredUpgrade> upgradesInventory = new();
|
||||
private void Start()
|
||||
{
|
||||
upgradeButton.onClick.AddListener((() => AddUpgrade(upgradeToAdd, player.mainAttackInstance)));
|
||||
// upgradeButton.onClick.AddListener((() => AddUpgrade(upgradeToAdd, player.mainAttackInstance)));
|
||||
}
|
||||
|
||||
public void StoreUpgrade(AbilityUpgrade upgradeToStore)
|
||||
{
|
||||
foreach (StoredUpgrade storedUpgrade in upgradesInventory)
|
||||
{
|
||||
if (storedUpgrade.upgrade == upgradeToStore)
|
||||
{
|
||||
storedUpgrade.count++;
|
||||
Debug.Log($"Added upgrade {storedUpgrade.upgrade.upgradeName}. Current count: {storedUpgrade.count}");
|
||||
AbilityUIHandler.instance.UpdateInventory();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
StoredUpgrade newUpgrade = new()
|
||||
{
|
||||
upgrade = upgradeToStore,
|
||||
count = 1
|
||||
};
|
||||
upgradesInventory.Add(newUpgrade);
|
||||
Debug.Log($"Added upgrade {newUpgrade.upgrade.upgradeName}. Current count: {newUpgrade.count}");
|
||||
AbilityUIHandler.instance.UpdateInventory();
|
||||
}
|
||||
|
||||
public void AddUpgrade(AbilityUpgrade upgrade, PlayerAbility ability)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue