this idiot forgot to commit an entire month's worth of code
This commit is contained in:
parent
c67146ea1a
commit
a3321d361c
51 changed files with 3644 additions and 84 deletions
58
Assets/Scripts/ShopManager.cs
Normal file
58
Assets/Scripts/ShopManager.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ShopManager : MonoBehaviour
|
||||
{
|
||||
#region Statication
|
||||
|
||||
public static ShopManager instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (instance != null && instance != this)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
return;
|
||||
}
|
||||
instance = this;
|
||||
DontDestroyOnLoad(this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
public List<AbilityUpgrade> buyableUpgrades;
|
||||
public int currency; //uh. we need to figure out this one lol
|
||||
public GameObject shopUIObject;
|
||||
[SerializeField] private Marisa player;
|
||||
public void GenerateUpgradeList()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void BuyUpgrade(AbilityUpgrade abilityToBuy)
|
||||
{
|
||||
if (currency >= abilityToBuy.cost)
|
||||
{
|
||||
AbilityManager.instance.upgradesInventory[abilityToBuy]++;
|
||||
currency -= abilityToBuy.cost;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SellUpgrade(AbilityUpgrade abilityToSell)
|
||||
{
|
||||
AbilityManager.instance.upgradesInventory[abilityToSell]--;
|
||||
currency += abilityToSell.cost/2;
|
||||
}
|
||||
|
||||
public void OpenShopUI()
|
||||
{
|
||||
shopUIObject.SetActive(true);
|
||||
player.stalled = true;
|
||||
}
|
||||
|
||||
public void CloseShopUI()
|
||||
{
|
||||
shopUIObject.SetActive(false);
|
||||
player.stalled = false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue