Ejemplo n.º 1
0
 private void ParseData(CSVLoader csvShopCat, CSVLoader csvShop)
 {
     for (int i = 0; i < csvShopCat.Rows; i++)
     {
         csvShopCat.ReadValue(0, i, string.Empty, out string Value);
         csvShopCat.ReadValue(1, i, 0, out int Value2);
         csvShopCat.ReadValue(2, i, 0, out int Value3);
         csvShopCat.ReadValue(3, i, 0, out int Value4);
         csvShopCat.ReadValue(4, i, 0, out int Value5);
         csvShopCat.ReadValue(5, i, 0, out int Value6);
         csvShopCat.ReadValue(6, i, 0, out int Value7);
         csvShopCat.ReadValue(7, i, 0, out int Value8);
         csvShopCat.ReadValue(8, i, 0, out int Value9);
         csvShopCat.ReadValue(9, i, 0, out int Value10);
         csvShopCat.ReadValue(10, i, 0, out int Value11);
         csvShopCat.ReadValue(11, i, 0, out int Value12);
         Value = Value.Trim().ToLower();
         TItem tItem = TItemManager.Instance.Get <TItem>(Value);
         if (dic.ContainsKey(Value))
         {
             Debug.LogError("Duplicated good found for " + Value);
         }
         else if (tItem == null)
         {
             Debug.LogError("Fail to find item template : " + Value);
         }
         else
         {
             tItem._StarRate = Value5;
             dic.Add(Value, new Good(Value, tItem, Value2 == 1, Value3 == 1, Value4 == 1, Value6 == 1, Value7 == 1, Value8 == 1, Value9 == 1, Value10 == 1, (sbyte)Value11, (sbyte)Value12));
         }
     }
     for (int j = 0; j < csvShop.Rows; j++)
     {
         csvShop.ReadValue(0, j, string.Empty, out string Value13);
         csvShop.ReadValue(1, j, 0, out int Value14);
         csvShop.ReadValue(2, j, 0, out int Value15);
         csvShop.ReadValue(3, j, 0, out int Value16);
         csvShop.ReadValue(4, j, 0, out int Value17);
         csvShop.ReadValue(5, j, 0, out int Value18);
         Value13 = Value13.Trim().ToLower();
         if (!dic.ContainsKey(Value13))
         {
             Debug.Log("Fail to find good : %d" + Value13);
         }
         else
         {
             dic[Value13].AddPrice(Value14, Value15, Value16, Value17, Value18, 0, 0, 0, 0, 0, 0, 314816281);
         }
     }
 }
Ejemplo n.º 2
0
 private void ParseCharacter(CSVLoader csvLoader)
 {
     for (int i = 0; i < csvLoader.Rows; i++)
     {
         csvLoader.ReadValue(0, i, string.Empty, out string Value);
         csvLoader.ReadValue(1, i, string.Empty, out string Value2);
         csvLoader.ReadValue(2, i, string.Empty, out string Value3);
         csvLoader.ReadValue(3, i, string.Empty, out string Value4);
         csvLoader.ReadValue(4, i, def: true, out bool Value5);
         csvLoader.ReadValue(5, i, string.Empty, out string Value6);
         csvLoader.ReadValue(6, i, string.Empty, out string Value7);
         csvLoader.ReadValue(7, i, string.Empty, out string Value8);
         csvLoader.ReadValue(8, i, string.Empty, out string Value9);
         csvLoader.ReadValue(9, i, def: false, out bool Value10);
         csvLoader.ReadValue(10, i, string.Empty, out string Value11);
         csvLoader.ReadValue(11, i, string.Empty, out string Value12);
         csvLoader.ReadValue(12, i, string.Empty, out string Value13);
         csvLoader.ReadValue(13, i, string.Empty, out string Value14);
         csvLoader.ReadValue(14, i, string.Empty, out string Value15);
         csvLoader.ReadValue(15, i, string.Empty, out string Value16);
         csvLoader.ReadValue(16, i, 100, out int Value17);
         Value.Trim();
         Value.ToLower();
         Value2.Trim();
         Value3.Trim();
         Value4.Trim();
         Value4.ToLower();
         Value6.Trim();
         Value7.Trim();
         Value8.Trim();
         Value9.Trim();
         Value12.Trim();
         Value13.Trim();
         Value14.Trim();
         Value15.Trim();
         Value16.Trim();
         int ct = TItem.String2Type(Value4);
         Add(Value, new TCharacter(Value, Value2, FindIcon(Value3), ct, Value5, Value6, Value7, Value8, BuffManager.Instance.Get(Value9), Value10, Value11, Convert.ToInt32(Value12), FindMaterial(Value13), Value14, Value15, Value16, Value17));
     }
 }
Ejemplo n.º 3
0
    private void ParseWeapon(CSVLoader csvLoader)
    {
        for (int i = 0; i < csvLoader.Rows; i++)
        {
            csvLoader.ReadValue(0, i, string.Empty, out string Value);
            csvLoader.ReadValue(1, i, string.Empty, out string Value2);
            csvLoader.ReadValue(2, i, string.Empty, out string Value3);
            csvLoader.ReadValue(3, i, string.Empty, out string Value4);
            csvLoader.ReadValue(4, i, string.Empty, out string Value5);
            csvLoader.ReadValue(5, i, string.Empty, out string Value6);
            csvLoader.ReadValue(6, i, string.Empty, out string Value7);
            csvLoader.ReadValue(7, i, string.Empty, out string Value8);
            csvLoader.ReadValue(8, i, def: true, out bool Value9);
            csvLoader.ReadValue(9, i, string.Empty, out string Value10);
            csvLoader.ReadValue(10, i, string.Empty, out string Value11);
            csvLoader.ReadValue(11, i, string.Empty, out string Value12);
            csvLoader.ReadValue(12, i, string.Empty, out string Value13);
            csvLoader.ReadValue(13, i, string.Empty, out string Value14);
            csvLoader.ReadValue(14, i, def: false, out bool Value15);
            csvLoader.ReadValue(15, i, string.Empty, out string Value16);
            csvLoader.ReadValue(16, i, -1, out int Value17);
            csvLoader.ReadValue(17, i, string.Empty, out string Value18);
            csvLoader.ReadValue(18, i, def: false, out bool Value19);
            csvLoader.ReadValue(19, i, string.Empty, out string Value20);
            csvLoader.ReadValue(20, i, string.Empty, out string Value21);
            csvLoader.ReadValue(21, i, string.Empty, out string Value22);
            csvLoader.ReadValue(22, i, string.Empty, out string Value23);
            csvLoader.ReadValue(23, i, def: false, out bool Value24);
            csvLoader.ReadValue(24, i, 100, out int Value25);
            Value8 = Value8.Trim();
            Value8 = Value8.ToLower();
            Value.Trim();
            Value.ToLower();
            Value2.Trim();
            Value3.Trim();
            Value4.Trim();
            Value5.Trim();
            Value5.ToLower();
            Value6.Trim();
            Value6.ToLower();
            Value7.Trim();
            Value7.ToLower();
            Value10.Trim();
            Value11.Trim();
            Value12.Trim();
            Value13.Trim();
            Value14.Trim();
            Value20.Trim();
            Value21.Trim();
            Value22.Trim();
            Value23.Trim();
            Value18 = Value18.ToLower();
            int     num     = TItem.String2Type(Value5);
            int     ck      = TItem.String2Kind(num, Value6);
            int     num2    = TWeapon.String2WeaponCategory(Value8);
            int     upCat   = TItem.String2UpgradeCategory(Value18);
            TWeapon tWeapon = new TWeapon(Value, Value2, Value12, FindPrefab(Value10), FindPrefab(Value11), FindIcon(Value3), FindIcon(Value4), num, ck, num2, Value9, TItem.String2Slot(Value7), Value13, BuffManager.Instance.Get(Value14), Value15, Value16, Value17, upCat, Value19, Convert.ToInt32(Value20), Value21, Value22, Value23, Value24, Value25);
            Add(Value, tWeapon);
            if (tWeapon.CurPrefab() != null)
            {
                WeaponFunction component = tWeapon.CurPrefab().GetComponent <WeaponFunction>();
                Gun            gun       = tWeapon.CurPrefab().GetComponent <Gun>();

                if (null == component)
                {
                    Debug.LogError(Value + " weapon does not have WeaponFunction");
                }
                else
                {
                    if (!wpnBy2Slot.ContainsKey((int)component.weaponBy))
                    {
                        wpnBy2Slot.Add((int)component.weaponBy, (int)tWeapon.slot);
                    }
                    if (!wpnBy2Category.ContainsKey((int)component.weaponBy))
                    {
                        wpnBy2Category.Add((int)component.weaponBy, num2);
                    }
                }
            }
        }
    }
Ejemplo n.º 4
0
 private void ParseCostume(CSVLoader csvLoader)
 {
     for (int i = 0; i < csvLoader.Rows; i++)
     {
         csvLoader.ReadValue(0, i, string.Empty, out string Value);
         csvLoader.ReadValue(1, i, string.Empty, out string Value2);
         csvLoader.ReadValue(2, i, string.Empty, out string Value3);
         csvLoader.ReadValue(3, i, string.Empty, out string Value4);
         csvLoader.ReadValue(4, i, string.Empty, out string Value5);
         csvLoader.ReadValue(5, i, string.Empty, out string Value6);
         csvLoader.ReadValue(6, i, def: true, out bool Value7);
         csvLoader.ReadValue(7, i, string.Empty, out string Value8);
         csvLoader.ReadValue(8, i, string.Empty, out string Value9);
         csvLoader.ReadValue(9, i, string.Empty, out string Value10);
         csvLoader.ReadValue(10, i, string.Empty, out string Value11);
         csvLoader.ReadValue(11, i, string.Empty, out string Value12);
         csvLoader.ReadValue(12, i, string.Empty, out string Value13);
         csvLoader.ReadValue(13, i, string.Empty, out string Value14);
         csvLoader.ReadValue(14, i, string.Empty, out string Value15);
         csvLoader.ReadValue(15, i, 0f, out float Value16);
         csvLoader.ReadValue(16, i, def: false, out bool Value17);
         csvLoader.ReadValue(17, i, string.Empty, out string Value18);
         csvLoader.ReadValue(18, i, 0, out int Value19);
         csvLoader.ReadValue(19, i, string.Empty, out string Value20);
         csvLoader.ReadValue(20, i, def: false, out bool Value21);
         csvLoader.ReadValue(21, i, string.Empty, out string Value22);
         csvLoader.ReadValue(22, i, string.Empty, out string Value23);
         csvLoader.ReadValue(23, i, string.Empty, out string Value24);
         csvLoader.ReadValue(24, i, string.Empty, out string Value25);
         csvLoader.ReadValue(25, i, string.Empty, out string Value26);
         csvLoader.ReadValue(26, i, string.Empty, out string Value27);
         csvLoader.ReadValue(27, i, 100, out int Value28);
         Value.Trim();
         Value.ToLower();
         Value2.Trim();
         Value3.Trim();
         Value4.Trim();
         Value4.ToLower();
         Value5.Trim();
         Value5.ToLower();
         Value6.Trim();
         Value6.ToLower();
         Value8.Trim();
         Value9.Trim();
         Value10.Trim();
         Value11.Trim();
         Value12.Trim();
         Value13.Trim();
         Value14.Trim();
         Value15.Trim();
         Value14 = Value14.ToLower();
         Value24.Trim();
         Value25.Trim();
         Value26.Trim();
         Value27.Trim();
         Value20 = Value20.ToLower();
         int num   = TItem.String2Type(Value4);
         int ck    = TItem.String2Kind(num, Value5);
         int upCat = TItem.String2UpgradeCategory(Value20);
         Add(Value, new TCostume(Value, Value2, Value10, Value11, FindMaterial(Value8), FindMaterial(Value9), FindIcon(Value3), num, ck, Value7, TItem.String2Slot(Value6), Value12, BuffManager.Instance.Get(Value13), Value17, Value18, Value19, upCat, Value21, Value23, FindMaterial(Value22), Convert.ToInt32(Value24), Value25, Value26, Value27, TItem.String2FunctionMask(Value14), Value16, FindIcon(Value15), Value28));
     }
 }