Unity 解析Excel所需要用到的工具,解压后直接放到项目中即可。
使用代码:
// 解析Excel
FileStream fs = new FileStream(Application.dataPath + "/Resources/Level/LevelConfig/Level_1001.xlsx", FileMode.Open, FileAccess.Read);
// 创建Excel读取类
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(fs);
while (excelReader.Read())
{
int testInt = excelReader.GetInt32(0);
string testStr = excelReader.GetString(1);
}
1