Beispiel #1
0
    public static void ParseData(string content, string fileName)
    {
        metaData = new Dictionary <int, MoreCardsDrawData>();

        CSVParser parser = new CSVParser();

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

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

        for (int i = 0; i < recordCounter; ++i)
        {
            data        = new MoreCardsDrawData();
            data.times_ = parser.GetInt(i, "time");
            data.cost_  = parser.GetInt(i, "cost");
            if (metaData.ContainsKey(data.times_))
            {
                ClientLog.Instance.LogError("MoreCardsDrawData" + ConfigLoader.Instance.csvext + "ID重复");
                return;
            }
            metaData[data.times_] = data;
        }
        parser.Dispose();
        parser = null;
    }
Beispiel #2
0
    void OnClickMask(GameObject go)
    {
        if (GamePlayer.Instance.isInBattle)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("battlecannot"), PopText.WarningType.WT_Warning, true);
            return;
        }

        if (BagSystem.instance.GetEmptySlotNum() == 0)
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("EN_OpenBaoXiangBagFull"), PopText.WarningType.WT_Warning);
            return;
        }

        MoreCardsDrawData mcdd = MoreCardsDrawData.GetData(MoreActivityData.GetCardsData().contents_.Length + 1);

        if (mcdd == null)
        {
            return;
        }

        COM_Item item = BagSystem.instance.GetItemByItemId((uint)needItem);

        if (item == null || item.stack_ < mcdd.cost_)
        {
            PopText.Instance.Show(string.Format(LanguageManager.instance.GetValue("notEnoughItemCount"), needItemName));
            return;
        }

        if (crtIdx != -1)
        {
            return;
        }

        UIEventListener listener = UIEventListener.Get(go);

        listener.onClick -= OnClickMask;
        int idx = (int)listener.parameter;

        if (idx >= 0 && idx < cards.Length)
        {
            if (cards[idx].isNew())
            {
                drawCardObj = go;
                crtIdx      = idx;
                NetConnection.Instance.openCard((ushort)idx);
                NetWaitUI.ShowMe();
            }
        }
    }
Beispiel #3
0
    void UpdateCoin()
    {
        MoreCardsDrawData mcdd = MoreCardsDrawData.GetData(MoreActivityData.GetCardsData().contents_.Length + 1);

        if (mcdd != null)
        {
            nextCost.text = mcdd.cost_.ToString();
        }
        else
        {
            nextCost.text = "-";
        }

        int num = BagSystem.instance.GetItemMaxNum((uint)needItem);

        leftCoin.text = num.ToString();
    }