Ejemplo n.º 1
0
    //public enum Language {
    //    korean,english
    //}

    //나중에 옵션에서 이거 바꾸는거 만든담에 연동시킨다. 키워드
    //public static Language language = Language.korean;

    public static string Exchange(string origin)
    {
        TableHandler.Row row = localizeTable.FindRow("key", origin);
        string           temp;

        //if (LanguageOption.currentLanguage == null)
        //{
        //    LanguageOption.Initialize();
        //}
        if (row != null)
        {
            temp = row.Get <string>(LanguageOption.currentLanguage.ToString());
            //temp = row.Get<string>("English");
        }
        else
        {
            temp = "'" + origin + "' can't find - ";
#if UNITY_EDITOR
            Debug.LogError("Localization Key '" + origin + "' can't find - ");
#endif
        }

#if UNITY_EDITOR
        if (temp.Contains("{"))
        {
            Debug.LogError("String Need More Value. Localize Key is " + origin);
        }
#endif

        return(temp);
    }
Ejemplo n.º 2
0
    public static string Exchange(string origin, string value, string value1)
    {
        TableHandler.Row row = localizeTable.FindRow("key", origin);
        string           temp;

        //if (LanguageOption.currentLanguage == null)
        //{
        //    LanguageOption.Initialize();
        //}

        if (row != null)
        {
            temp = string.Format(row.Get <string>(LanguageOption.currentLanguage.ToString()), value, value1);
        }
        else
        {
            temp = "'" + origin + "' can't find - ";
            Debug.LogError("Localization Key '" + origin + "' can't find - ");
        }

        if (temp.Contains("{"))
        {
            Debug.LogError("String Need More Value. Localize Key is " + origin);
        }

        return(temp);
    }
Ejemplo n.º 3
0
    private int CalcUpgradePrice(int u)
    {
        TableHandler.Row row = TableHandler.Get(DesignConstStorage.tNameCarPrice, TableHandler.SteamMode.Resource).Rows[Index];

        int carPrice = row.Get <int>("price") * 2;

        int price = (int)(carPrice * 0.1f) * (u + 1);

        return(price);
    }
Ejemplo n.º 4
0
    public void TrackSelect(TableHandler.Row trackData = null)
    {
        if (trackData == null)
        {
            trackData = DesignConstStorage.TrackDataTable.Rows[UnityEngine.Random.Range(0, DesignConstStorage.TrackDataTable.Rows.Count)];

            trackData = DesignConstStorage.TrackDataTable.Rows[UnityEngine.Random.Range(0, 1)];
        }

        string tName = trackData.Get <string>("mapname");

        Map_Name = trackData.Get <string>("index");
        int startSection  = trackData.Get <int>("startsection");
        int sectionLength = trackData.Get <int>("sectionlength");

        current_track = trackList[tName];
        Set_current_track(startSection, sectionLength);

        //Debug.Log("선택한 트랙 : " + string.Format("Track : {0}  StartSection : {1}  Length : {2}", tName, startSection, sectionLength));
    }
Ejemplo n.º 5
0
    public void Initialize(TableHandler.Row data)
    {
        carName = data.Get <string>("index");

        price = data.Get <int>("price");

        Status = new Dictionary <DesignConstStorage.StatList, int>();

        for (int i = 0; i <= (int)DesignConstStorage.StatList.accelerating; i++)
        {
            SetStat((DesignConstStorage.StatList)i, data.Get <int>(((DesignConstStorage.StatList)i).ToString()));
        }

        tsc = data.Get <int>("tsc");
        acc = data.Get <int>("acc");
        coc = data.Get <int>("coc");
        brc = data.Get <int>("brc");

        //ModStatus();
    }
Ejemplo n.º 6
0
    public bool PurchaseProduct(Store_Information p)
    {
        //상품의 결제 타입에 따라 각 위치에서 항목 제공한다.

        //Debug.LogError(p.Item_Name);
        //return false;

        switch (p.Price_Type)
        {
        case WealthManager.WealthType.Cash:
            //뒤끝쪽에 상품코드 전달한다.
            UseCash(p);
            break;

        case WealthManager.WealthType.GameMoney:
            //차량 구매 or 업글
            //게임머니 차감하고 차량 등록하거나 업글한다.
            TableHandler.Row row = TableHandler.Get(DesignConstStorage.tNameCarPrice, TableHandler.SteamMode.Resource).FindRow <string>("index", p.Item_Name);

            bool isPaid = WealthManager.Instance.SpendWealth(p.Price_Type, row.Get <int>("price") * 2);

            if (isPaid)
            {
                p.ProvideItems();
                //Debug.LogError(p.Item_Name);
                //Game_Manager.Instance.backendManager.AddNewCar(p.Item_Name);
                //Game_Manager.Instance.backendManager.GetFreshCarStat();
            }
            else
            {
                return(false);
            }
            break;

        case WealthManager.WealthType.RealMoney:
            OnBtnPurchaseClicked(p);
            break;
        }

        return(true);
    }
Ejemplo n.º 7
0
 public bool Initialize(TableHandler.Row row, int i)
 {
     category = i;
     data = row;
     return true;
 }
Ejemplo n.º 8
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);
    }