导表工具完善

dev_chengFeng
jl_ios 2020-08-15 16:38:43 +08:00 committed by gaoxin
parent d256a6da7c
commit 21ea44a475
1 changed files with 11 additions and 9 deletions

View File

@ -15,6 +15,7 @@ namespace GameEditor.Core.DataConfig
static string m_Bench;
static string[] m_Files;
static bool[] m_Choose;
static string shellPath;
[MenuItem("Data Config/Export")]
private static void ShowConfigWin()
@ -33,14 +34,16 @@ namespace GameEditor.Core.DataConfig
private static void LoadDic()
{
m_Files = Directory.GetDirectories(m_ExcelPath, "*", SearchOption.TopDirectoryOnly);
m_Choose = new bool[m_Files.Length];
for (int i = 0; i < m_Files.Length; i++)
if (!string.IsNullOrEmpty(m_ExcelPath) && Directory.Exists(m_ExcelPath))
{
m_Choose[i] = m_Files[i] == m_Bench;
}
m_Files = Directory.GetDirectories(m_ExcelPath, "*", SearchOption.TopDirectoryOnly);
m_Choose = new bool[m_Files.Length];
for (int i = 0; i < m_Files.Length; i++)
{
m_Choose[i] = m_Files[i] == m_Bench;
}
}
}
private static void SaveLocalConfig()
{
@ -71,7 +74,7 @@ namespace GameEditor.Core.DataConfig
//Application.dataPath 只能在主线程中获取
int lastIndex = Application.dataPath.LastIndexOf("/");
string shellPath = Application.dataPath.Substring(0, lastIndex) + "/Shell/";
shellPath = Application.dataPath.Substring(0, lastIndex) + "/Shell/";
// 新开线程防止锁死
Thread newThread = new Thread(new ParameterizedThreadStart(CmdOpenDirectory));
@ -123,7 +126,7 @@ namespace GameEditor.Core.DataConfig
EditorGUILayout.Space();
EditorGUILayout.LabelField("请选择分支:");
if(m_Files.Length != 0)
if(m_Files != null && m_Files.Length != 0)
{
for (int i = 0; i < m_Files.Length; i++)
{
@ -131,7 +134,6 @@ namespace GameEditor.Core.DataConfig
}
}
else {
EditorGUILayout.LabelField("未找到分支");
}
EditorGUILayout.EndVertical();