Merge commit '8085adfe259dc0167b67c5786871493bd8ce9a1d' into china/local

dev_chengFeng
JieLing 2021-06-28 13:34:31 +08:00
commit 618c8b635f
2 changed files with 96 additions and 16 deletions

View File

@ -86,13 +86,19 @@ end
function this.UpdateHongMengDataHeroInfos(hongmengHeroInfos)
this.hongmengHeroInfos = hongmengHeroInfos
--LogGreen("hongmengHeroInfos "..#this.hongmengHeroInfos)
-- LogGreen("hongmengHeroInfos "..#this.hongmengHeroInfos)
for i = 1, #this.hongmengHeroInfos do
if this.hongmengHeroInfos[i].time ~= 0 then
-- body
this.hongmengHeroInfos[i].time = this.hongmengHeroInfos[i].time + GetTimeStamp()
end
-- print(HeroManager.)
--鸿蒙阵共鸣后直接大于20级 后没有赋值大闹天宫英雄血量 大闹天宫一键上阵报错
-- LogYellow("this.hongmengHeroInfos[i].heroId "..this.hongmengHeroInfos[i].heroId)
if not ExpeditionManager.heroInfo[this.hongmengHeroInfos[i].heroId] then
-- LogRed("this.hongmengHeroInfos[i].heroId "..this.hongmengHeroInfos[i].heroId)
ExpeditionManager.InitHeroHpValue(this.hongmengHeroInfos[i].heroId)
end
end
if this.hongmengAdditions[1] then

View File

@ -1,7 +1,10 @@
using GameCore;
using GameEditor.Util;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using UnityEditor;
using UnityEngine;
@ -13,18 +16,36 @@ namespace GameEditor.Core.DataConfig
{
static string m_ExcelPath;
static string m_BattleConfigPath;
static string m_BattleConfigRootPath;
static string m_Bench;
static string[] m_Files;
static bool[] m_Choose;
static string shellPath;
static string m_CurGitBench;
static string m_CurServerBattlePath;
static Dictionary<string, string> ServerBattleConfig = new Dictionary<string, string>();
//{
// new string[]{ "china/test", "master_zh_test"},
// new string[]{ "china/zf_test", "master_zh_online_special"},
//};
[MenuItem("Data Config/Export")]
private static void ShowConfigWin()
{
ServerBattleConfig.Clear();
ServerBattleConfig.Add("china/dev", "test");
ServerBattleConfig.Add("china/test", "master_zh_test");
ServerBattleConfig.Add("china/zf_test", "master_zh_online_special");
m_CurGitBench = GitUtil.GetCurBenchName();
ServerBattleConfig.TryGetValue(m_CurGitBench, out m_CurServerBattlePath);
m_ExcelPath = EditorPrefs.GetString("m_ExcelPath");
m_BattleConfigPath = EditorPrefs.GetString("m_BattleConfigPath");
m_BattleConfigRootPath = EditorPrefs.GetString("m_BattleConfigRootPath");
m_Bench = EditorPrefs.GetString("m_Bench");
LoadDic();
var win = GetWindow<ConfigExportWindow>();
@ -67,11 +88,10 @@ 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_Bench", m_Bench);
}
public static void OpenDirectory(string path)
{
if (string.IsNullOrEmpty(path)) return;
@ -114,13 +134,13 @@ namespace GameEditor.Core.DataConfig
p.Close();
}
private string[] battleConfigList = new string[]
private static string[] battleConfigList = new string[]
{
"PassiveSkillLogicConfig",
"HardStage",
"HardStageCondition",
};
public static bool isUpDateOnline = false;
private void OnGUI()
{
@ -168,25 +188,73 @@ namespace GameEditor.Core.DataConfig
// 导表
DataConfigWindow.excelALLConfig(true, m_Bench + "/base_data");
}
if(m_CurServerBattlePath!= null)
{
EditorGUILayout.LabelField("战斗数据表同步根路径:");
m_BattleConfigRootPath = EditorGUILayout.TextField("", m_BattleConfigRootPath);
EditorGUILayout.LabelField("目标战斗校验服文件夹为:"+m_CurServerBattlePath);
if (GUILayout.Button("同步到战斗校验服并提交", GUILayout.Height(40f)))
{
UpdateSVNBattleData();
SaveLocalConfig();
// 导表
//isUpDateOnline = true;
//DataConfigWindow.excelALLConfig(false, m_Bench + "/base_data");
}
}
EditorGUILayout.LabelField("战斗数据表同步路径:");
m_BattleConfigPath = EditorGUILayout.TextField("", m_BattleConfigPath);
if (GUILayout.Button("同步战斗数据表", GUILayout.Height(40f)))
{
string sourcePath = Application.dataPath + "/ManagedResources/~lua/Config/Data/";
for(int i = 0; i < battleConfigList.Length; i++)
{
string luaFile = sourcePath + battleConfigList[i] + ".lua";
string targetPath = m_BattleConfigPath +"/"+ battleConfigList[i] + ".lua";
UnityEngine.Debug.Log(battleConfigList[i]);
File.Copy(luaFile, targetPath, true);
}
// 同步
UnityEngine.Debug.Log("同步成功");
CopyBattleFiles(m_BattleConfigPath);
// 保存数据
SaveLocalConfig();
}
}
void UpdateSVNBattleData()
{
string targetPath = Path.Combine(m_BattleConfigRootPath, m_CurServerBattlePath);
string svnPath = targetPath + "\\Modules";
// 拉取一次
ProcessUtil.ProcessCommand(svnPath, "svn update");
//
CopyBattleFiles(targetPath + "/Modules/Battle/Config/Data");
//
string PackTime = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss");
string commitMsg = string.Format("{0}同步数据表{1}", m_CurServerBattlePath, PackTime);
// 重写Readme文件
string readMePath = svnPath + "/Battle/Readme.txt";
string[] flines = File.ReadAllLines(readMePath, System.Text.Encoding.UTF8);
List<string> wlines = flines.ToList();
wlines.Insert(0, commitMsg);
File.WriteAllLines(readMePath, wlines.ToArray(), System.Text.Encoding.UTF8);
// 提交到SVN
ProcessUtil.ProcessCommand(svnPath, "svn add . --force");
ProcessUtil.ProcessCommand(svnPath, "svn commit -m " + commitMsg);
UnityEngine.Debug.Log("同步SVN完成");
}
// 将战斗相关数据表文件同步到目标文件夹
void CopyBattleFiles(string targetPath)
{
UnityEngine.Debug.Log("同步战斗文件到目标路径:"+ targetPath);
string sourcePath = Application.dataPath + "/ManagedResources/~lua/Config/Data/";
for (int i = 0; i < battleConfigList.Length; i++)
{
string luaFile = sourcePath + battleConfigList[i] + ".lua";
string path = targetPath + "/" + battleConfigList[i] + ".lua";
UnityEngine.Debug.Log(battleConfigList[i]);
File.Copy(luaFile, path, true);
}
// 同步
UnityEngine.Debug.Log("同步完成!");
}
}
@ -287,6 +355,12 @@ namespace GameEditor.Core.DataConfig
UnityEngine.Debug.LogError("耗时:" + time.ElapsedMilliseconds);
EditorUtil.ShowSureDialog("配置表数据导入完毕!");
//if (ConfigExportWindow.isUpDateOnline)
//{
// ConfigExportWindow.UpdateSVNBattleData();
// ConfigExportWindow.isUpDateOnline = false;
//}
}
};
@ -347,7 +421,7 @@ namespace GameEditor.Core.DataConfig
{
excelALLConfig(true, DataConfigSetting.execlDir);
}
private static void exportSheet(DataConfigSetting setting, string path, bool isIncrement)
{
string fileExt = Path.GetExtension(path).ToLower();