private void drawImportExportGUI() { GUIStyle btnStyle = new GUIStyle(GUI.skin.GetStyle("Button")) { fixedWidth = 100, alignment = TextAnchor.MiddleCenter }; EditorGUILayout.BeginHorizontal(); GUILayout.Label("Import from: ", EditorStyles.label); drawBtn("Google Sheet", btnStyle, ImportToggle.GoogleSheet, () => { // download excel from google sheet Action <string> callback = (string path) => { // parse excel file ImportFromExcel(path); }; WebTool.DownloadXLSX(GameConstant.GoogleSheetId, callback, fileName); }); drawBtn("Excel", btnStyle, ImportToggle.Excel, () => { string path = EditorUtility.OpenFilePanel("Open Excel File", GameConstant.ExcelSourceFolder, "xlsx"); if (path.Length != 0) { ImportFromExcel(path); } }); drawBtn("Json", btnStyle, ImportToggle.Json, () => { string path = EditorUtility.OpenFilePanel("Open Json File", GameConstant.JsonSourceFolder, "json"); if (path.Length != 0) { ImportFromJson(path); } }); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); GUILayout.Label("Export to: ", EditorStyles.label); drawBtn("Google Sheet", btnStyle, ExportToggle.GoogleSheet); drawBtn("Excel", btnStyle, ExportToggle.Excel, () => { var path = EditorUtility.SaveFilePanel("Save Excel File", GameConstant.ExcelSourceFolder, string.Format("{0}.{1}", fileName, "xlsx"), "xlsx"); if (path.Length != 0) { ExportToExcel(path); } }); drawBtn("Json", btnStyle, ExportToggle.Json, () => { var path = EditorUtility.SaveFilePanel("Save Json File", GameConstant.JsonSourceFolder, string.Format("{0}.{1}", fileName, "json"), "json"); if (path.Length != 0) { ExportToJson(path); } }); EditorGUILayout.EndHorizontal(); }