Esempio n. 1
0
        //查询PropEnternal表
        public static List <PropEnternal> SelectPropEnternalTable()
        {
            string              sheetName  = "PropEnternal";
            DataRowCollection   collect    = ExcelAccess.ReadExcel(excelName, 0);
            List <PropEnternal> propEArray = new List <PropEnternal>();

            for (int i = 1; i < collect.Count; i++)
            {
                if (collect[i][1].ToString() == "")
                {
                    continue;
                }

                PropEnternal PropE = new PropEnternal
                {
                    Objindex = new ObjectIndex()
                    {
                        Id       = Convert.ToInt32(collect[i][0].ToString()),
                        Name     = collect[i][1].ToString(),
                        Comments = collect[i][2].ToString(),
                    },
                    Itemtype     = ItemType.Properties,
                    Price        = Convert.ToInt32(collect[i][3].ToString()),
                    IsMarketable = Convert.ToBoolean(collect[i][4].ToString()),
                    Bagshow      = Resources.Load <Sprite>("Item/" + Convert.ToInt32(collect[i][0].ToString())),
                    PProperties  = new StatsBase()
                    {
                        HpM   = Convert.ToSingle(collect[i][6].ToString()),
                        HpR   = Convert.ToSingle(collect[i][7].ToString()),
                        Atk   = Convert.ToSingle(collect[i][8].ToString()),
                        NAtk  = Convert.ToSingle(collect[i][9].ToString()),
                        FAtk  = Convert.ToSingle(collect[i][10].ToString()),
                        Def   = Convert.ToSingle(collect[i][11].ToString()),
                        SpdM  = Convert.ToSingle(collect[i][12].ToString()),
                        SpdA  = Convert.ToSingle(collect[i][13].ToString()),
                        MpM   = Convert.ToInt32(collect[i][14].ToString()),
                        MpR   = Convert.ToInt32(collect[i][15].ToString()),
                        CritP = Convert.ToSingle(collect[i][16].ToString()),
                        CritM = Convert.ToSingle(collect[i][17].ToString()),
                        MgM   = Convert.ToSingle(collect[i][18].ToString()),
                    }

                    /*m_Id = collect[i][0].ToString(),
                     * m_level = collect[i][1].ToString(),
                     * m_parentId = collect[i][2].ToString(),
                     * m_name = collect[i][3].ToString()*/
                };
                propEArray.Add(PropE);
            }
            return(propEArray);
        }
Esempio n. 2
0
    /*public Equip ExpEquip1 = new Equip();
    *  public Equip ExpEquip2 = new Equip();*/
    // Use this for initialization
    void Start()
    {
        PropEnternalHolder propEnternalHolder = AssetDatabase.LoadAssetAtPath <PropEnternalHolder>("Assets/Resources/PropEnternals.asset");
        PropRecoverHolder  propRecoverHolder  = AssetDatabase.LoadAssetAtPath <PropRecoverHolder>("Assets/Resources/PropRecovers.asset");

        Equiptype[] equiptypes = Enum.GetValues(typeof(Equiptype)) as Equiptype[];

        for (int i = 0; i < 5; i++)
        {
            Item item = new PropEnternal();
            item = propEnternalHolder.EnternalPropList[i];
            Bag.getItem(item, i + 1);
        }

        for (int i = 6; i < 10; i++)
        {
            Item item = new PropEnternal();
            item = propRecoverHolder.RecoverPropList[i - 5];
            Bag.getItem(item, i - 4);
        }

        /*ExpProp[0] = new PropRecover
         *      {
         *              Objindex =
         *              {
         *                      Id = 1,
         *                      Name = "数值回复10"
         *              },
         *              Price = 10,
         *              byValue = true,
         *              PIntimeProperties =
         *              {
         *                      HpI = 10,
         *              }
         *
         *      };
         *      Bag.getItem(ExpProp[0],10);
         *
         * ExpProp[1] = new PropRecover
         * {
         *      Objindex =
         *      {
         *              Id = 2,
         *              Name = "比例回复20%"
         *      },
         *      Price = 10,
         *      byValue = false,
         *      MIntimeProperties =
         *      {
         *              HpI = 0.2f,
         *      }
         *
         * };
         * Bag.getItem(ExpProp[1],10);
         *
         * ExpProp[2] = new PropEnternal()
         * {
         *      Objindex =
         *      {
         *              Id = 3,
         *              Name = "数值提升10上限"
         *      },
         *      Price = 10,
         *      PProperties =
         *      {
         *              HpM = 10,
         *      }
         *
         * };
         * Bag.getItem(ExpProp[2],10);*/

        for (int i = 0; i < 6; i++)
        {
            ExpEquip[i]             = new Equip();
            ExpEquip[i].Objindex.Id = 100 + i;

            if (equiptypes != null)
            {
                if (i < 5)
                {
                    ExpEquip[i].Equiptype = equiptypes[i];
                }
                else
                {
                    ExpEquip[i].Equiptype = equiptypes[4];
                }
            }
            ExpEquip[i].Objindex.Name = "装备" + ExpEquip[i].Equiptype + i;

            ExpEquip[i].Price = 100 * i;
            Bag.getItem(ExpEquip[i], i + 1);
        }
    }
Esempio n. 3
0
File: Test.cs Progetto: Reguluz/LNMH
    /*public Equip ExpEquip1 = new Equip();
    *  public Equip ExpEquip2 = new Equip();*/
    // Use this for initialization
    void Start()
    {
        Equiptype[] equiptypes = Enum.GetValues(typeof(Equiptype)) as Equiptype[];

        ExpProp[0] = new PropRecover
        {
            Objindex =
            {
                Id   = 1,
                Name = "数值回复10"
            },
            Price             = 10,
            byValue           = true,
            PIntimeProperties =
            {
                HpI = 10,
            }
        };
        Bag.getItem(ExpProp[0], 10);

        ExpProp[1] = new PropRecover
        {
            Objindex =
            {
                Id   = 2,
                Name = "比例回复20%"
            },
            Price             = 10,
            byValue           = false,
            MIntimeProperties =
            {
                HpI = 0.2f,
            }
        };
        Bag.getItem(ExpProp[1], 10);

        ExpProp[2] = new PropEnternal()
        {
            Objindex =
            {
                Id   = 3,
                Name = "数值提升10上限"
            },
            Price       = 10,
            PProperties =
            {
                HpM = 10,
            }
        };
        Bag.getItem(ExpProp[2], 10);

        for (int i = 0; i < 6; i++)
        {
            ExpEquip[i]             = new Equip();
            ExpEquip[i].Objindex.Id = 100 + i;

            if (equiptypes != null)
            {
                if (i < 5)
                {
                    ExpEquip[i].Equiptype = equiptypes[i];
                }
                else
                {
                    ExpEquip[i].Equiptype = equiptypes[4];
                }
            }
            ExpEquip[i].Objindex.Name = "装备" + ExpEquip[i].Equiptype + i;

            ExpEquip[i].Price = 100 * i;
            Bag.getItem(ExpEquip[i], i + 1);
        }
    }