diff --git a/Assets/QuickSheet/Editor/BaseMachineEditor.cs b/Assets/QuickSheet/Editor/BaseMachineEditor.cs
index 1838c9b..ad36b61 100644
--- a/Assets/QuickSheet/Editor/BaseMachineEditor.cs
+++ b/Assets/QuickSheet/Editor/BaseMachineEditor.cs
@@ -42,7 +42,7 @@ public override void OnInspectorGUI()
///
/// It should be overried and implemented in the derived class
///
- protected virtual void Import(bool reimport = false)
+ public virtual void Import(bool reimport = false)
{
throw new NotImplementedException();
}
@@ -66,7 +66,7 @@ protected bool IsValidHeader(string s)
/// Generate script files with the given templates.
/// Total four files are generated, two for runtime and others for editor.
///
- protected virtual ScriptPrescription Generate(BaseMachine m)
+ public virtual ScriptPrescription Generate(BaseMachine m)
{
if (m == null)
return null;
@@ -395,5 +395,11 @@ protected ColumnHeader ParseColumnHeader(string columnheader, int order)
return new ColumnHeader { name = cHeader, type = CellType.Undefined, OrderNO = order };
}
+
+ public static void CreateGenerateDirectory(BaseMachine machine)
+ {
+ Directory.CreateDirectory(Application.dataPath + Path.DirectorySeparatorChar + machine.RuntimeClassPath);
+ Directory.CreateDirectory(Application.dataPath + Path.DirectorySeparatorChar + machine.EditorClassPath);
+ }
}
}
\ No newline at end of file
diff --git a/Assets/QuickSheet/Editor/QuickSheetMenu.cs b/Assets/QuickSheet/Editor/QuickSheetMenu.cs
new file mode 100644
index 0000000..003264f
--- /dev/null
+++ b/Assets/QuickSheet/Editor/QuickSheetMenu.cs
@@ -0,0 +1,156 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using UnityEditor;
+using UnityEngine;
+
+namespace UnityQuickSheet
+{
+ public static class QuickSheetMenu
+ {
+ ///
+ /// Select currently exist account setting asset file.
+ ///
+ [MenuItem("QuickSheet/Excel Setting")]
+ public static void SelectExcelSetting()
+ {
+ Selection.activeObject = ExcelSettings.Instance;
+ if (Selection.activeObject == null)
+ {
+ Debug.LogError(@"No ExcelSetting.asset file is found. Create setting file first. See the menu at 'Create/QuickSheet/Setting/Excel Setting'.");
+ }
+ }
+
+ ///
+ /// Select currently exist account setting asset file.
+ ///
+ [MenuItem("QuickSheet/Google Data Setting")]
+ public static void SelectGoogleDataSetting()
+ {
+ Selection.activeObject = GoogleDataSettings.Instance;
+ if (Selection.activeObject == null)
+ {
+ Debug.LogError("No GoogleDataSettings.asset file is found. Create setting file first.");
+ }
+ }
+
+ ///
+ /// Setup selected excel files
+ /// 1.Create Machine Asset
+ /// 2.Reimport Machine
+ /// 3.Generate Class
+ /// 4.Reimport Excel file
+ ///
+ [MenuItem("QuickSheet/Setup Select Excels")]
+ public static void SetupSelectExcels()
+ {
+ if (Selection.assetGUIDs.Length == 0)
+ {
+ EditorUtility.DisplayDialog("Error", "Select excel files to setup!", "OK");
+ return;
+ }
+
+ var selectObjs = new List