Exemple #1
0
        public static List <PropRecover> SelectPropRecoverTable()
        {
            string            sheetName = "PropRecover";
            DataRowCollection collect   = ExcelAccess.ReadExcel(excelName, 1);

            List <PropRecover> PropRArray = new List <PropRecover>();

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

                PropRecover PropR = new PropRecover
                {
                    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())),
                    PIntimeProperties = new StatsIntime()
                    {
                        HpI = Convert.ToSingle(collect[i][6].ToString()),
                        MpI = Convert.ToSingle(collect[i][7].ToString()),
                        MgI = Convert.ToSingle(collect[i][8].ToString()),
                    },
                    Buffs = new List <int>()
                };
                for (int j = 9; j < 16; j++)
                {
                    if (collect[i][j] != null)
                    {
                        PropR.Buffs.Add(Convert.ToInt32(collect[i][j].ToString()));
                    }
                    else
                    {
                        break;
                    }
                }
                PropRArray.Add(PropR);
            }
            return(PropRArray);
        }
Exemple #2
0
    /*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);
        }
    }