void CleanClient() { var files = Directory.GetFiles(ExcelExporterUtil.GetClientClassOutputPath()); for (int i = 0; i < files.Length; i++) { var fileName = Path.GetFileName(files[i]); if (fileName.StartsWith("Cfg") && fileName.EndsWith(".cs")) { File.Delete(files[i]); } } files = Directory.GetFiles(ExcelExporterUtil.GetClientDataOutputPath()); for (int i = 0; i < files.Length; i++) { var fileName = Path.GetFileName(files[i]); if (fileName.EndsWith(".bytes")) { File.Delete(files[i]); } } ExcelTextClassGenerater.GenerateClientClassFactory(ExcelExporterUtil.GetClientDataOutputPath(), ExcelExporterUtil.GetClientClassOutputPath() + "Base/", true); AssetDatabase.Refresh(); }
void GenerateSelectedData() { if (_selectFiles.Count == 0) { Debug.LogError("没有选中excel"); return; } for (int i = 0; i < _selectFiles.Count; i++) { GenSingleClientData(_selectFiles[i]); } if (ExcelExporterUtil.exportType == ExcelDataExportType.Text) { //必须有这个文件 ExcelTextClassGenerater.GenerateClientClassFactory(ExcelExporterUtil.GetClientDataOutputPath(), ExcelExporterUtil.GetClientClassOutputPath() + "Base/", false); } AssetDatabase.Refresh(); }
public void GenerateClientScript() { var generater = ClassFactory.GetFactory(GeneraterFactoryType.Client).Create(); generater.GenerateClass(ExcelExporterUtil.GetClientClassOutputPath(), ExcelExporterUtil.GetClientClassFileName(fileName), clientData); }