Exemplo n.º 1
0
    public void SetData(JGetShopItem json)
    {
        txtCoinName.text = json.item_name[0];
        itemID           = json.item_id;
        string imagePath = BundleManager.instance.GetItemLoadPath(DownloadType.THUMB, json.item_type_id, json.item_id);

        BundleManager.instance.LoadImage(imgCoin, imagePath);
        priceIDR  = long.Parse(json.price_idr);
        priceCoin = long.Parse(json.price_coin);
        if (priceIDR != 0)
        {
            paymentType = 0;
            txtPriceCoin.gameObject.SetActive(false);
            objImageCoin.SetActive(false);
            txtPriceIDR.gameObject.SetActive(true);
            txtPriceIDR.text = "IDR " + priceIDR.ToString("N0");
        }
        else if (priceCoin != 0)
        {
            paymentType = 1;
            txtPriceIDR.gameObject.SetActive(false);
            objImageCoin.SetActive(true);
            txtPriceCoin.gameObject.SetActive(true);
            txtPriceCoin.text = priceCoin.toShortCurrency();
        }
    }
Exemplo n.º 2
0
    public void SetData(JGetShopItem json)
    {
        jHero            = json;
        txtHeroName.text = json.item_name[0];
        SetOwnedStatus(json.is_hero_owned, (json.default_item_id == PlayerData.costume_id));
        string imagePath = BundleManager.instance.GetItemLoadPath(DownloadType.THUMB, json.item_type_id, json.item_id);

        BundleManager.instance.LoadImage(imgHero, imagePath);
    }
Exemplo n.º 3
0
    public void SetData(JGetShopItem json)
    {
        heroID           = json.hero_type_id;
        txtHeroName.text = json.item_name[0];
        string imagePath = BundleManager.instance.GetItemLoadPath(DownloadType.THUMB, json.item_type_id, json.item_id);

        BundleManager.instance.LoadImage(imgHero, imagePath);
        if (objEmpty != null)
        {
            objEmpty.SetActive(false);
        }
    }
Exemplo n.º 4
0
    public void SetData(JGetShopItem json)
    {
        txtHeroName.text = json.item_name[0];
        itemID           = json.item_id;
        //load image hero
        string imagePath = BundleManager.instance.GetItemLoadPath(DownloadType.THUMB, json.item_type_id, json.item_id);

        BundleManager.instance.LoadImage(imgHero, imagePath);
        priceIDR  = long.Parse(json.price_idr);
        priceCoin = long.Parse(json.price_coin);
        if (json.is_hero_owned)
        {
            txtPriceCoin.gameObject.SetActive(false);
            objImageCoin.SetActive(false);
            txtPriceIDR.gameObject.SetActive(true);
            txtPriceIDR.color   = colTextOwned;
            txtPriceIDR.text    = "Diperoleh";
            btnBuy.interactable = false;
        }
        else if (priceIDR != 0)
        {
            paymentType = 0;
            txtPriceCoin.gameObject.SetActive(false);
            objImageCoin.SetActive(false);
            txtPriceIDR.gameObject.SetActive(true);
            txtPriceIDR.text    = "IDR " + priceIDR.ToString("N0");
            txtPriceIDR.color   = Color.white;
            btnBuy.interactable = true;
        }
        else if (priceCoin != 0)
        {
            paymentType = 1;
            txtPriceIDR.gameObject.SetActive(false);
            objImageCoin.SetActive(true);
            txtPriceCoin.gameObject.SetActive(true);
            txtPriceCoin.text   = priceCoin.toShortCurrency();
            btnBuy.interactable = true;
        }
    }