Ejemplo n.º 1
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());
    }