| | |
| | | public class TableTool : EditorWindow
|
| | | {
|
| | |
|
| | | public static string configOutPutPath = UnityEngine.Application.dataPath + "/StreamingAssets/Config";
|
| | | public static string configOutPutPath;
|
| | | static bool isIL = false; // 导出表代码是否IL使用
|
| | |
|
| | | [UnityEditor.MenuItem("策划工具/导出策划表到游戏工程")]
|
| | | static void Init()
|
| | | {
|
| | | configOutPutPath = UnityEngine.Application.dataPath + "/StreamingAssets/Config";
|
| | | window = GetWindow(typeof(TableTool), true, "策划导表工具") as TableTool;
|
| | | window.position = new Rect(UnityEngine.Screen.width / 2, UnityEngine.Screen.height / 2, 300, 700);
|
| | | window.Show();
|
| | |
| | | GUILayout.BeginHorizontal();
|
| | | if (GUILayout.Button("导出表"))
|
| | | {
|
| | | isIL = false;
|
| | | ReadAllTxt();
|
| | | GenAllClass();
|
| | | MessageBox.Show("导出表成功!");
|
| | |
| | | }
|
| | | GUILayout.EndHorizontal();
|
| | |
|
| | | GUILayout.EndVertical();
|
| | | GUILayout.BeginHorizontal();
|
| | | if (GUILayout.Button("导出IL表"))
|
| | | {
|
| | | isIL = true;
|
| | | ReadAllTxt();
|
| | | GenAllClass();
|
| | | MessageBox.Show("导出IL表成功!");
|
| | | AssetDatabase.Refresh();
|
| | | isIL = false;
|
| | | }
|
| | | GUILayout.EndHorizontal();
|
| | |
|
| | |
|
| | | if (GUILayout.Button("选择路径"))
|
| | | {
|
| | |
| | | #endif
|
| | |
|
| | | }
|
| | | GUIUtility.ExitGUI();
|
| | | }
|
| | |
|
| | | private void ShowTableNames()
|
| | |
| | | }
|
| | | FileStream fileStream = _tableNameLst[i].fileInfo.OpenRead();
|
| | | StreamReader sr = new StreamReader(fileStream, Encoding.Default);
|
| | | CreateConfigClassFile.CreateConfigClass(_tableNameLst[i].fileInfo);
|
| | | CreateConfigClassFile.CreateConfigClass(_tableNameLst[i].fileInfo, isIL);
|
| | | sr.Dispose();
|
| | | sr.Close();
|
| | | }
|