예제 #1
0
    public void AddGold(int quantity, ShopCoin coinType = ShopCoin.Gold)
    {
        switch (coinType)
        {
        case ShopCoin.Gold:
            gold += quantity;
            break;

        case ShopCoin.Secret:
            secretGold += quantity;
            break;
        }
    }
예제 #2
0
    public void SetGold(int quantity, ShopCoin coinType = ShopCoin.Gold)
    {
        switch (coinType)
        {
        case ShopCoin.Gold:
            onChangeGold?.Invoke(quantity);
            gold = quantity;
            break;

        case ShopCoin.Secret:
            onChangeSecretGold?.Invoke(quantity);
            secretGold = quantity;
            break;
        }
    }
    public void UpdatePlayerGold(int quantity, ShopCoin coin)
    {
        switch (coin)
        {
        case ShopCoin.Gold:
            yourGold.text = quantity.ToString();
            lastGold      = quantity;
            break;

        case ShopCoin.Secret:
            yourSecret.text = quantity.ToString();
            lastSecretGold  = quantity;
            break;
        }
    }
예제 #4
0
    public void SetGold(int quantity, ShopCoin coinType, bool callAction = true)
    {
        switch (coinType)
        {
        case ShopCoin.Gold:
            if (callAction)
            {
                onChangeGold?.Invoke(quantity);
            }
            gold = quantity;
            break;

        case ShopCoin.Secret:
            if (callAction)
            {
                onChangeSecretGold?.Invoke(quantity);
            }
            secretGold = quantity;
            break;
        }
    }