public void LoadCSV() { Dictionary <int, EntityCsvData> dataDic = CsvDataCached.GetCsvFileDatas <EntityCsvData>(); Debug.Log("开始读取CSV文件对象"); foreach (EntityCsvData csvData in dataDic.Values) { Debug.Log(csvData.ID + ":" + csvData.Name); } Debug.Log("读取CSV文件对象结束"); }
// path 相对与StreamingAssets的路径 public static List <T> ReaderCSV <T>(string path) { CsvDataCached.CachedCsvFile <T>(path); Dictionary <int, T> dataDic = CsvDataCached.GetCsvFileDatas <T>(); List <T> list = new List <T>(); foreach (T item in dataDic.Values) { list.Add(item); } return(list); }