Exemplo n.º 1
0
        public void CalcWealth(WealthManager.WealthType type, GameInfoOperator op, int amount)
        {
            Param param = new Param();

            param.AddCalculation(type.ToString(), op, amount);

            BackendReturnObject bro = Backend.GameInfo.UpdateWithCalculation(DesignConstStorage.tNameWealth, PInfo.wealthinDate, param);

            string sCode = bro.GetStatusCode();

            if (sCode != "204")
            {
                Debug.LogError(sCode);
            }
            else
            {
            }
        }
Exemplo n.º 2
0
    }// item
    public bool Initialize(TableHandler.Row data, bool isCar = false)
    {
        bool isFinish = true;

        item_List = new List <ItemType>();

        item_name = data.Get <string>("index");
        category  = data.Get <string>("category");

        BE.BackendManager.UIDInfo uInfo = Game_Manager.Instance.backendManager.GetProductUUID(item_name);
        if (uInfo.name == Item_Name)
        {
            //캐시를 써서 구매하는 상품
            uuid  = uInfo.uuid;
            price = uInfo.price.ToString();
        }
        else
        {
            //캐시를 사용하지 않는 상품. 현금 or 게임머니 구매상품
        }

        isPurchased = PlayerPrefs.GetString(Item_Name) == Purchased;

        string tcName = "";

        if (isCar)
        {
            item_List.Add(ItemType.car);
            value_List.Add(Item_Name);

            tcName = "wealthtype";
        }
        else
        {
            for (int i = 0; i < 4; i++)
            {
                value_List.Add(data.Get <string>("value" + i));
                string t = data.Get <string>("item" + i);
                if (t != "")
                {
                    item_List.Add((ItemType)System.Enum.Parse(typeof(ItemType), t));
                }
            }

            tcName = "pricetype";
        }

        var p = IAPManager.storeController.products.WithID(item_name);

        if (p != null)
        {
            if (p.metadata.isoCurrencyCode == "KRW")
            {
                price = "₩ " + p.metadata.localizedPrice.ToString();
            }
            else
            {
                price = "$ " + p.metadata.localizedPrice.ToString();
            }
        }

        switch (data.Get <string>(tcName))
        {
        case "realmoney": price_type = WealthManager.WealthType.RealMoney;
            break;

        case "cash": price_type = WealthManager.WealthType.Cash;
            price = uInfo.price.ToString();
            break;

        case "gamemoney": price_type = WealthManager.WealthType.GameMoney;
            price = (data.Get <int>("price") * 2).ToString();
            break;
        }

        //ProvideItems();

        return(isFinish);
    }