SK_LongZhu
parent
a25b53a9b1
commit
cf288e1915
|
@ -13,7 +13,7 @@ using UnityEngine;
|
|||
namespace GameEditor.Core.DataConfig
|
||||
{
|
||||
|
||||
public class ConfigExportWindow:EditorWindow
|
||||
public class ConfigExportWindow : EditorWindow
|
||||
{
|
||||
static string m_ExcelPath;
|
||||
static string m_BattleConfigPath;
|
||||
|
@ -102,7 +102,7 @@ namespace GameEditor.Core.DataConfig
|
|||
// 保存数据
|
||||
EditorPrefs.SetString("m_ExcelPath", m_ExcelPath);
|
||||
EditorPrefs.SetString("m_BattleConfigPath", m_BattleConfigPath);
|
||||
EditorPrefs.SetString("m_BattleConfigRootPath",m_BattleConfigRootPath);
|
||||
EditorPrefs.SetString("m_BattleConfigRootPath", m_BattleConfigRootPath);
|
||||
EditorPrefs.SetString("m_Bench", m_Bench);
|
||||
}
|
||||
|
||||
|
@ -178,14 +178,22 @@ namespace GameEditor.Core.DataConfig
|
|||
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("请选择分支:");
|
||||
if(m_Files != null && m_Files.Length != 0)
|
||||
if (m_Files != null && m_Files.Length != 0)
|
||||
{
|
||||
for (int i = 0; i < m_Files.Length; i++)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
m_Choose[i] = EditorGUILayout.ToggleLeft(m_Files[i], m_Choose[i]);
|
||||
i++;
|
||||
if (i < m_Files.Length)
|
||||
{
|
||||
m_Choose[i] = EditorGUILayout.ToggleLeft(m_Files[i], m_Choose[i]);
|
||||
}
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
else {
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.LabelField("未找到分支");
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
@ -204,11 +212,11 @@ namespace GameEditor.Core.DataConfig
|
|||
// 导表
|
||||
DataConfigWindow.excelALLConfig(true, m_Bench + "/base_data");
|
||||
}
|
||||
if(m_CurServerBattlePath!= null)
|
||||
if (m_CurServerBattlePath != null)
|
||||
{
|
||||
EditorGUILayout.LabelField("战斗数据表同步根路径:");
|
||||
m_BattleConfigRootPath = EditorGUILayout.TextField("", m_BattleConfigRootPath);
|
||||
EditorGUILayout.LabelField("目标战斗校验服文件夹为:"+m_CurServerBattlePath);
|
||||
EditorGUILayout.LabelField("目标战斗校验服文件夹为:" + m_CurServerBattlePath);
|
||||
if (GUILayout.Button("同步到战斗校验服并提交", GUILayout.Height(40f)))
|
||||
{
|
||||
UpdateSVNBattleData();
|
||||
|
@ -259,7 +267,7 @@ namespace GameEditor.Core.DataConfig
|
|||
// 将战斗相关数据表文件同步到目标文件夹
|
||||
void CopyBattleFiles(string targetPath)
|
||||
{
|
||||
UnityEngine.Debug.Log("同步战斗文件到目标路径:"+ targetPath);
|
||||
UnityEngine.Debug.Log("同步战斗文件到目标路径:" + targetPath);
|
||||
string sourcePath = Application.dataPath + "/ManagedResources/~lua/Config/Data/";
|
||||
for (int i = 0; i < battleConfigList.Length; i++)
|
||||
{
|
||||
|
@ -304,7 +312,7 @@ namespace GameEditor.Core.DataConfig
|
|||
|
||||
public static void excelALLConfig(bool isIncrement, string path)
|
||||
{
|
||||
if(path == "")
|
||||
if (path == "")
|
||||
{
|
||||
path = DataConfigSetting.execlDir;
|
||||
}
|
||||
|
@ -521,16 +529,16 @@ namespace GameEditor.Core.DataConfig
|
|||
|
||||
void OnGUI()
|
||||
{
|
||||
if(excels == null)
|
||||
if (excels == null)
|
||||
{
|
||||
excels = new List<DataExcelSetting>();
|
||||
if (!string.IsNullOrEmpty(DataConfigSetting.execlDir) && Directory.Exists(DataConfigSetting.execlDir))
|
||||
{
|
||||
string[] files = Directory.GetFiles(DataConfigSetting.execlDir, "*.*", SearchOption.AllDirectories);
|
||||
EditorUtility.DisplayProgressBar("Loading", "loading excel", 0f);
|
||||
for(int i =0;i<files.Length;i++)
|
||||
for (int i = 0; i < files.Length; i++)
|
||||
{
|
||||
EditorUtility.DisplayProgressBar("Loading", "loading excel:"+files[i], ((float)i)/files.Length);
|
||||
EditorUtility.DisplayProgressBar("Loading", "loading excel:" + files[i], ((float)i) / files.Length);
|
||||
string fileExt = Path.GetExtension(files[i]).ToLower();
|
||||
if (fileExt == ".xlsx" || fileExt == ".xls")
|
||||
{
|
||||
|
@ -551,11 +559,12 @@ namespace GameEditor.Core.DataConfig
|
|||
tabType = (TabType)GUILayout.Toolbar((int)tabType, TabNames, "LargeButton", GUILayout.Width(toolbarWidth));
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
Rect contentRect = new Rect(2, 40, position.width-4, position.height - 60);
|
||||
Rect contentRect = new Rect(2, 40, position.width - 4, position.height - 60);
|
||||
if (tabType == TabType.Setting)
|
||||
{
|
||||
settingTab.OnGUI(contentRect);
|
||||
} else if (tabType == TabType.Excel)
|
||||
}
|
||||
else if (tabType == TabType.Excel)
|
||||
{
|
||||
excelTab.OnGUI(contentRect);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue