Пример #1
0
    public static void ParseData(string content, string fileName)
    {
        metaData = new Dictionary <int, ACT_RewardData> ();

        CSVParser parser = new CSVParser();

        if (!parser.Parse(content))
        {
            ClientLog.Instance.LogError("AchieveData" + ConfigLoader.Instance.csvext + "解析错误");
            return;
        }

        int            recordCounter = parser.GetRecordCounter();
        ACT_RewardData data          = null;

        for (int i = 0; i < recordCounter; ++i)
        {
            data         = new ACT_RewardData();
            data._Id     = parser.GetInt(i, "ID");
            data._ItemID = parser.GetInt(i, "itemID");
            data._Price  = parser.GetInt(i, "price");
            if (metaData.ContainsKey(data._Id))
            {
                ClientLog.Instance.LogError("AchieveData" + ConfigLoader.Instance.csvext + "ID重复");
                return;
            }
            metaData[data._Id] = data;
        }
        parser.Dispose();
        parser = null;
    }
Пример #2
0
 void Start()
 {
     RewardItem.SetActive(false);
     qustItem.SetActive(false);
     foreach (KeyValuePair <int, ACT_RewardData> pair in ACT_RewardData.GetData())
     {
         actRewData.Add(pair.Value);
     }
     foreach (KeyValuePair <int, ActivityData> pair in ActivityData.GetData())
     {
         actData.Add(pair.Value);
     }
     ActivityEventOk = PlayerActivityEventOk;
     AddRewardItem(actRewData);
     AddQustItem(actData);
     PlayerActivityEventOk();
 }
Пример #3
0
    void InitRewardIcon()
    {
        Dictionary <int, ACT_RewardData> actdata = ACT_RewardData.GetData();

        foreach (KeyValuePair <int, ACT_RewardData> par in actdata)
        {
            adata.Add(par.Value);
        }
        for (int i = 0; i < adata.Count; i++)
        {
            //if(adata[i]!= null)
            ItemCellUI ic = UIManager.Instance.AddItemCellUI(sps[i], (uint)adata[i]._ItemID);
            ic.cellPane.spriteName = "";
            ic.showTips            = true;
            cells.Add(ic);
            //HeadIconLoader.Instance.LoadIcon (ItemData.GetData(adata[i]._ItemID).icon_, icons[i]);
        }
    }
Пример #4
0
    public static int minprice_()
    {
        List <ACT_RewardData> actRewData = new List <ACT_RewardData>();

        foreach (KeyValuePair <int, ACT_RewardData> pair in ACT_RewardData.GetData())
        {
            actRewData.Add(pair.Value);
        }

        int min = 0;

        for (int i = 0; i < actRewData.Count; i++)
        {
            min = actRewData[0]._Price;
            if (min > actRewData[i]._Price)
            {
                min = actRewData[i]._Price;
            }
        }
        return(min);
    }