Esempio n. 1
0
    protected void SetGoodsPrice(int price, RuneGrade runeGrade)
    {
        if (RuneService.IsPlusGrade(runeGrade))
        {
            price = RuneService.GetPriceOfPlusGrade(runeGrade);
        }

        goodsPrice.text = price.ToString();
    }
    protected new void SetGoodsPrice(int price, PurchaseCurrency purchaseCurrency)
    {
        if (RuneService.IsPlusGrade(runeGrade))
        {
            price = RuneService.GetPriceOfPlusGrade(runeGrade);
        }

        goodsPrice.text = price.ToString();

        switch (purchaseCurrency)
        {
        case PurchaseCurrency.Gold:
        {
            if (price <= PlayerDataManager.Instance.playerData.Gold)
            {
                goodsPrice.color = Color.black;
            }
            else
            {
                goodsPrice.color = Color.red;
            }
        }
        break;

        case PurchaseCurrency.Diamond:
        {
            if (price <= PlayerDataManager.Instance.playerData.Diamond)
            {
                goodsPrice.color = Color.black;
            }
            else
            {
                goodsPrice.color = Color.red;
            }
        }
        break;

        default:
            Debug.LogError("Error SetGoodsPrice!!");
            break;
        }
    }