使用插件:
Litjson:用于json的解析
Epplus:用于读取xlsx格式的表格
代码
using LitJson;
using OfficeOpenXml;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public static class ExcelToJson
{
private static string excelPath = Path.Combine(UnityEngine.Application.streamingAssetsPath, "Data", "Excel");
private static string jsonPath = Path.Combine(UnityEngine.Application.streamingAssetsPath, "Data", "Json");
public static void ReadExcel(string excelName)
{
List<Dictionary<string, string>> finalData = new