导表工具完善
parent
d256a6da7c
commit
21ea44a475
|
@ -15,6 +15,7 @@ namespace GameEditor.Core.DataConfig
|
||||||
static string m_Bench;
|
static string m_Bench;
|
||||||
static string[] m_Files;
|
static string[] m_Files;
|
||||||
static bool[] m_Choose;
|
static bool[] m_Choose;
|
||||||
|
static string shellPath;
|
||||||
|
|
||||||
[MenuItem("Data Config/Export")]
|
[MenuItem("Data Config/Export")]
|
||||||
private static void ShowConfigWin()
|
private static void ShowConfigWin()
|
||||||
|
@ -33,14 +34,16 @@ namespace GameEditor.Core.DataConfig
|
||||||
private static void LoadDic()
|
private static void LoadDic()
|
||||||
{
|
{
|
||||||
|
|
||||||
m_Files = Directory.GetDirectories(m_ExcelPath, "*", SearchOption.TopDirectoryOnly);
|
if (!string.IsNullOrEmpty(m_ExcelPath) && Directory.Exists(m_ExcelPath))
|
||||||
m_Choose = new bool[m_Files.Length];
|
|
||||||
|
|
||||||
for (int i = 0; i < m_Files.Length; i++)
|
|
||||||
{
|
{
|
||||||
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()
|
private static void SaveLocalConfig()
|
||||||
{
|
{
|
||||||
|
@ -71,7 +74,7 @@ namespace GameEditor.Core.DataConfig
|
||||||
|
|
||||||
//Application.dataPath 只能在主线程中获取
|
//Application.dataPath 只能在主线程中获取
|
||||||
int lastIndex = Application.dataPath.LastIndexOf("/");
|
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));
|
Thread newThread = new Thread(new ParameterizedThreadStart(CmdOpenDirectory));
|
||||||
|
@ -123,7 +126,7 @@ namespace GameEditor.Core.DataConfig
|
||||||
|
|
||||||
EditorGUILayout.Space();
|
EditorGUILayout.Space();
|
||||||
EditorGUILayout.LabelField("请选择分支:");
|
EditorGUILayout.LabelField("请选择分支:");
|
||||||
if(m_Files.Length != 0)
|
if(m_Files != null && m_Files.Length != 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_Files.Length; i++)
|
for (int i = 0; i < m_Files.Length; i++)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +134,6 @@ namespace GameEditor.Core.DataConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
EditorGUILayout.LabelField("未找到分支");
|
EditorGUILayout.LabelField("未找到分支");
|
||||||
}
|
}
|
||||||
EditorGUILayout.EndVertical();
|
EditorGUILayout.EndVertical();
|
||||||
|
|
Loading…
Reference in New Issue