少年修仙传客户端基础资源
hch
2024-04-29 4d6bbc5541b1fd03d5a2b1d42bc881f9598c191b
0312 导表工具默认选中当前工程的表目录,不再手动选目录
1个文件已修改
93 ■■■■ 已修改文件
Assets/Editor/Tool/TableTool.cs 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/TableTool.cs
@@ -19,7 +19,7 @@
        window = GetWindow(typeof(TableTool), true, "策划导表工具") as TableTool;
        window.position = new Rect(UnityEngine.Screen.width / 2, UnityEngine.Screen.height / 2, 300, 700);
        window.Show();
        PathCache();
        //PathCache();
    }
    public class FileToggleInfo
@@ -40,6 +40,7 @@
    private static List<FileToggleInfo> _tableNameLst = new List<FileToggleInfo>(); //所有表名字列表
    private void OnGUI()
    {
        _tablePath = UnityEngine.Application.dataPath + "/ResourcesOut/Refdata/Config";
        GUILayout.BeginVertical();
        GUILayout.TextArea("策划配表路径:" + _tablePath);
@@ -73,34 +74,34 @@
        }
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("导出IL表"))
        {
            isIL = true;
            ReadAllTxt();
            GenAllClass();
            MessageBox.Show("导出IL表成功!");
            AssetDatabase.Refresh();
            isIL = false;
        }
        GUILayout.EndHorizontal();
//        GUILayout.BeginHorizontal();
//        if (GUILayout.Button("导出IL表"))
//        {
//            isIL = true;
//            ReadAllTxt();
//            GenAllClass();
//            MessageBox.Show("导出IL表成功!");
//            AssetDatabase.Refresh();
//            isIL = false;
//        }
//        GUILayout.EndHorizontal();
        if (GUILayout.Button("选择路径"))
        {
#if UNITY_EDITOR
            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
//        if (GUILayout.Button("选择路径"))
//        {
//#if UNITY_EDITOR
//            FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
            if (folderBrowserDialog.ShowDialog() == DialogResult.OK || folderBrowserDialog.ShowDialog() == DialogResult.Yes)
            {
                _tablePath = folderBrowserDialog.SelectedPath + "\\";
                PathCache(_tablePath);
            }
//            if (folderBrowserDialog.ShowDialog() == DialogResult.OK || folderBrowserDialog.ShowDialog() == DialogResult.Yes)
//            {
//                _tablePath = folderBrowserDialog.SelectedPath + "\\";
//                PathCache(_tablePath);
//            }
            folderBrowserDialog.Dispose();
#endif
//            folderBrowserDialog.Dispose();
//#endif
        }
//        }
        GUIUtility.ExitGUI();
    }
@@ -285,28 +286,28 @@
    /// 路径缓存
    /// </summary>
    /// <param name="setPath"></param>
    private static void PathCache(string setPath = "")
    {
        DebugEx.Log("路径缓存:" + setPath);
        string configPath = UnityEngine.Application.dataPath;
        configPath = configPath + "/ResourcesOut/Refdata/Config/PathCache/TablePath.txt";
        FileStream configPathTxt = File.Open(configPath, FileMode.Open);
        if (string.IsNullOrEmpty(setPath))
        {
            StreamReader sr = new StreamReader(configPathTxt);
            string path = sr.ReadToEnd();
            _tablePath = path;
            sr.Dispose();
            sr.Close();
        }
        else
        {
            StreamWriter sw = new StreamWriter(configPathTxt);
            sw.Write(setPath);
            sw.Dispose();
            sw.Close();
        }
    }
    //private static void PathCache(string setPath = "")
    //{
    //    DebugEx.Log("路径缓存:" + setPath);
    //    string configPath = UnityEngine.Application.dataPath;
    //    configPath = configPath + "/ResourcesOut/Refdata/Config/PathCache/TablePath.txt";
    //    FileStream configPathTxt = File.Open(configPath, FileMode.Open);
    //    if (string.IsNullOrEmpty(setPath))
    //    {
    //        StreamReader sr = new StreamReader(configPathTxt);
    //        string path = sr.ReadToEnd();
    //        _tablePath = path;
    //        sr.Dispose();
    //        sr.Close();
    //    }
    //    else
    //    {
    //        StreamWriter sw = new StreamWriter(configPathTxt);
    //        sw.Write(setPath);
    //        sw.Dispose();
    //        sw.Close();
    //    }
    //}
}
public class Param