少年修仙传客户端基础资源
hch
2021-03-04 1cabe469aeb05c933f20b557aacd804792b69c35
Assets/Editor/Tool/TableTool.cs
@@ -11,11 +11,13 @@
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();
@@ -65,6 +67,7 @@
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("导出表"))
        {
            isIL = false;
            ReadAllTxt();
            GenAllClass();
            MessageBox.Show("导出表成功!");
@@ -72,7 +75,18 @@
        }
        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("选择路径"))
        {
@@ -89,6 +103,7 @@
#endif
        }
        GUIUtility.ExitGUI();
    }
    private void ShowTableNames()
@@ -262,7 +277,7 @@
            }
            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();
        }