Example #1
0
 public BuyableInfo(BuyableInfo template)
 {
     price          = template.price;
     maintenance    = template.maintenance;
     recupOnDisband = template.recupOnDisband;
     revenue        = template.revenue;
     type           = template.type;
     thumbnail      = template.thumbnail;
 }
Example #2
0
    public void OnBuy(BuyableInfo info, out bool success)
    {
        PopupHandler popupHandler = FindObjectOfType <PopupHandler>();

        if (currentPlayer.CurrentGold() < info.price)
        {
            popupHandler.OnInfoPupup(new InfoPopupInfo()
            {
                infoText = "You don't have enough money", okText = "Ok"
            });
            success = false;
            return;
        }
        success = true;
        RemoveGold(info.price);
        StartCoroutine(RefreshDelay());
    }
Example #3
0
 public void RemoveBuyable(BuyableInfo info)
 {
     assets.Remove(info);
     Economy.Instance.Refresh();
 }
Example #4
0
 public void AddBuyableNoRefresh(BuyableInfo info)
 {
     assets.Add(info);
 }
Example #5
0
 public void AddBuyable(BuyableInfo info)
 {
     assets.Add(info);
     Economy.Instance.Refresh();
 }