예제 #1
0
    public void LoadOriginItemInfoListFromFile(string a_oFilepath)
    {
        var oTextAsset = Resources.Load <TextAsset>(a_oFilepath);
        var oJSONRoot  = SimpleJSON.JSON.Parse(oTextAsset.text);

        var oCardInfoList = oJSONRoot["OriginCardInfoList"];

        for (int i = 0; i < oCardInfoList.Count; ++i)
        {
            var oInfoList = oCardInfoList[i];

            var stCardInfo = new STCardInfo();

            stCardInfo.m_nID     = int.Parse(oInfoList["ID"]);
            stCardInfo.m_nSlot   = int.Parse(oInfoList["Slot"]);
            stCardInfo.m_nAmount = int.Parse(oInfoList["Amount"]);
            stCardInfo.m_nAtk    = int.Parse(oInfoList["Atk"]);
            stCardInfo.m_nDef    = int.Parse(oInfoList["Def"]);
            stCardInfo.m_fHp     = float.Parse(oInfoList["Hp"]);
            stCardInfo.m_fDelay  = float.Parse(oInfoList["Delay"]);
            stCardInfo.m_nLV     = int.Parse(oInfoList["LV"]);

            stCardInfo.m_bIsSelect = bool.Parse(oInfoList["Select"]);
            stCardInfo.m_oName     = oInfoList["Name"];

            m_oCardInfoList.Add(stCardInfo);
        }
    }
예제 #2
0
    public void LevelUp(string a_oName)
    {
        for (int i = 0; i < this.m_oCardInfoList.Count; ++i)
        {
            if (m_oCardInfoList[i].m_oName == a_oName)
            {
                if (m_oCardInfoList[i].m_nLV >= 5)
                {
                    break;
                }

                var stCardInfo = new STCardInfo();
                stCardInfo.m_nID     = m_oCardInfoList[i].m_nID;
                stCardInfo.m_nSlot   = m_oCardInfoList[i].m_nSlot;
                stCardInfo.m_nAmount = m_oCardInfoList[i].m_nAmount;
                stCardInfo.m_nAtk    = m_oCardInfoList[i].m_nAtk + 5;
                stCardInfo.m_nDef    = m_oCardInfoList[i].m_nDef + 5;
                stCardInfo.m_fHp     = m_oCardInfoList[i].m_fHp;
                stCardInfo.m_fDelay  = m_oCardInfoList[i].m_fDelay - 0.3f;
                stCardInfo.m_nLV     = m_oCardInfoList[i].m_nLV + 1;


                stCardInfo.m_bIsSelect = true;
                stCardInfo.m_oName     = m_oCardInfoList[i].m_oName;

                m_oCardInfoList[i] = stCardInfo;
            }
        }
    }