static void LoadMissionData(string path,MasterShop data) { using (FileStream stream = File.Open(path, FileMode.Open, FileAccess.Read)) { IWorkbook book = new HSSFWorkbook(stream); ISheet sheet = book.GetSheetAt(0); Debug.Log(sheet.SheetName); IRow row0 = sheet.GetRow(0); //一番最初のフィールドは見出しなので無視 for (int i = 1; i < sheet.LastRowNum; i++) { IRow row = sheet.GetRow(i); //エクセルデータを編集したらこことMasterCharacterに追加すれば更新できるよ MasterShop.param p = new MasterShop.param(); p.id = (int)row.GetCell(0).NumericCellValue; p.name = row.GetCell(1).StringCellValue; p.subscripsion = row.GetCell(2).StringCellValue; p.gold = (int)row.GetCell(3).NumericCellValue; p.hot = (int)row.GetCell(4).NumericCellValue; p.stress = (int)row.GetCell(5).NumericCellValue; p.category = (int)row.GetCell(6).NumericCellValue; p.res = row.GetCell(7).StringCellValue; p.color = row.GetCell(8).StringCellValue; p.gread = (int)row.GetCell(9).NumericCellValue; data.list.Add(p); } } }
public void SetParam(MasterShop.param p) { parametor = p; }