Merge branches 'china/dev' and 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev

dev_chengFeng
ZhangBiao 2021-09-18 11:04:17 +08:00
commit 49cb8272bc
14 changed files with 193 additions and 117 deletions

View File

@ -4,34 +4,30 @@ using System.IO;
using System;
using GameEditor.FrameTool;
using GameEditor.Util;
using System.Collections;
using System.Collections.Generic;
public class PackConfig
{
public string name;
public string scene;
public string project;
public string version;
public string bench;
public PackConfig(string _name, string _scene, string _project, string _version, string _bench)
{
name = _name;
scene = _scene;
project = _project;
version= _version;
bench = _bench;
}
}
public class AutoPack : EditorWindow
{
static string[][] PackConfig = new string[][]
{
// 内网包
new string[]{ "内网包", "Logo_gm_nosdk", "TCX_LOCAL", "china/local"},
// 专服
new string[]{ "C轮v2", "Logo_gm_nosdk", "TCX_TEST_C_V2", "china/zf_test"},
new string[]{ "灵动专服-测试", "Logo_gn_zf_test", "MHT_GN_ZF_TEST" , "china/zf_test"},
new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE3" , "china/zf_test"},
new string[]{ "喜扑", "Logo_cn_xipu", "MHT_CN_XIPU", "china/zf_test"},
new string[]{ "草花", "Logo_cn_caohua", "MHT_CN_MIDDLE_WARE" , "china/zf_test"},
new string[]{ "游心", "Logo_cn_youxin", "MHT_CN_YOUXIN", "china/zf_test"},
new string[]{ "动游", "Logo_cn_dongyou", "MHT_CN_DONGYOU", "china/zf_test"},
new string[]{ "渠道-MHT", "Logo_gn_zf_quick", "MHT_GN_ZF_QUICK", "china/zf_test"},
new string[]{ "渠道-Quick", "Logo_cn_quick", "MHT_CN_QUICK" , "china/zf_test"},
// 灵动商务
new string[]{ "灵动商务", "Logo_mht_sw", "MHT_GN_SW" , "china/mht_sw"},
//先遣
new string[]{ "跨服", "LogoChinaXQCS", "MHT_GN_KUAFU", "china/test"},
new string[]{ "先遣-测试", "LogoChinaXQCS", "MHT_GN_XQ_TEST", "china/test"},
new string[]{ "先遣", "LogoChinaXQ", "MHT_GN_XQ", "china/test"},
};
static List<PackConfig> PackConfig = new List<PackConfig>();
#if UNITY_ANDROID
static string Platform = "Android";
@ -75,7 +71,26 @@ public class AutoPack : EditorWindow
ScenePath = Application.dataPath + "/LuaFramework/Scenes/";
ABPath = Application.dataPath + "/../BuildABs/" + Platform + "/";
ExportType = 2;
Chooser = new bool[PackConfig.Length];
// 加载配置
LoadConfig();
}
static void LoadConfig()
{
PackConfig.Clear();
Hashtable config = ClientConfigManager.Instance.GetAutoPackConfig();
foreach (string k in config.Keys)
{
Hashtable ht = config[k] as Hashtable;
string name = k;
string scene = ht["scene"] as string;
string project = ht["project"] as string;
string version = ht["version"] as string;
string bench = ht["bench"] as string;
PackConfig.Add(new PackConfig(name, scene, project, version, bench));
}
Chooser = new bool[PackConfig.Count];
}
/// <summary>
@ -105,7 +120,7 @@ public class AutoPack : EditorWindow
benchName = GitUtil.GetCurBenchName();
UnityEngine.Debug.Log("当前分支:" + benchName);
//创建窗口
Rect wr = new Rect(0, 0, 500, 700);
Rect wr = new Rect(0, 0, 500, 1000);
var buildWin = GetWindowWithRect<AutoPack>(wr, true);
buildWin.titleContent = new GUIContent("打包工具");
buildWin.Show();
@ -137,31 +152,31 @@ public class AutoPack : EditorWindow
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.LabelField("请选择要打的包:");
for(int i = 0; i < PackConfig.Length; i++)
for(int i = 0; i < PackConfig.Count; i++)
{
if (PackConfig[i][3].Equals(benchName))
if (PackConfig[i].bench.Equals(benchName))
{
EditorGUILayout.BeginVertical();
Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i][0], Chooser[i]);
Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i].name, Chooser[i]);
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("编辑Config", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + ConfigFileName;
string tpath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[i].version + "/" + ConfigFileName;
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("编辑Version", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + VersionFileName;
string tpath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[i].version + "/" + VersionFileName;
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("编辑Gradle", GUILayout.Height(20f)))
{
string tpath = _MomPackPath + PackConfig[i][2] + "/build.gradle";
string tpath = _MomPackPath + PackConfig[i].project + "/build.gradle";
GameEditor.Util.ProcessUtil.OpenText(tpath);
}
if (GUILayout.Button("更新蓝鲸SDK", GUILayout.Height(20f)))
{
File.Copy(_MomPackPath + "BlueWhaleJar/app/build/outputs/aar/app-release.aar", _MomPackPath + PackConfig[i][2] + "/libs/BlueWhale.aar", true);
File.Copy(_MomPackPath + "BlueWhaleJar/app/build/outputs/aar/app-release.aar", _MomPackPath + PackConfig[i].project + "/libs/BlueWhale.aar", true);
Debug.Log("更新完成");
}
EditorGUILayout.EndHorizontal();
@ -195,16 +210,16 @@ public class AutoPack : EditorWindow
for (int i = 0; i < Chooser.Length; i++)
{
if (!Chooser[i]) continue;
string sceneFilePath = ScenePath + PackConfig[i][1];
string sceneFilePath = ScenePath + PackConfig[i].scene;
if (!File.Exists(sceneFilePath + ".unity"))
{
Debug.LogError(PackConfig[i][0] + " 未找到场景:" + sceneFilePath);
Debug.LogError(PackConfig[i].name + " 未找到场景:" + sceneFilePath);
check_result = true;
}
string momPath = _MomPackPath + PackConfig[i][2];
string momPath = _MomPackPath + PackConfig[i].project;
if (!Directory.Exists(momPath))
{
Debug.LogError(PackConfig[i][0] + " 未找到母包:" + momPath);
Debug.LogError(PackConfig[i].name + " 未找到母包:" + momPath);
check_result = true;
}
}
@ -250,7 +265,7 @@ public class AutoPack : EditorWindow
public static void CreateLogFile(int index)
{
APKPath = _MomPackPath + PackConfig[index][2] + "/APK/";
APKPath = _MomPackPath + PackConfig[index].project + "/APK/";
if (!Directory.Exists(APKPath))
{
Directory.CreateDirectory(APKPath);
@ -266,7 +281,7 @@ public class AutoPack : EditorWindow
// 导出android 工程
public static void ExportAS(int index)
{
string pName = PackConfig[index][1] + "__" + PackConfig[index][2];
string pName = PackConfig[index].scene + "__" + PackConfig[index].project;
PlayerSettings.productName = pName;
PlayerSettings.Android.useAPKExpansionFiles = isObb;
if (isObb)
@ -285,8 +300,8 @@ public class AutoPack : EditorWindow
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
// 设置需要打包的场景
string launchScene = "Assets/LuaFramework/Scenes/" + PackConfig[index][1] + ".unity";
Debug.Log(PackConfig[index][0] + ":打包场景:" + launchScene);
string launchScene = "Assets/LuaFramework/Scenes/" + PackConfig[index].scene + ".unity";
Debug.Log(PackConfig[index].name + ":打包场景:" + launchScene);
BuildPlayerOptions bpo = new BuildPlayerOptions();
bpo.locationPathName = ExportPackPath;
bpo.options = BuildOptions.None;
@ -295,8 +310,8 @@ public class AutoPack : EditorWindow
bpo.target = BuildTarget.Android;
// 调用开始打包
BuildPipeline.BuildPlayer(bpo);
Debug.Log(PackConfig[index][0] + "android工程导出路径" + ExportPackPath + "/" + pName);
Debug.Log(PackConfig[index][0] + "android工程导出完成");
Debug.Log(PackConfig[index].name + "android工程导出路径" + ExportPackPath + "/" + pName);
Debug.Log(PackConfig[index].name + "android工程导出完成");
}
static string[] ReplaceDir = new string[]
@ -312,8 +327,8 @@ public class AutoPack : EditorWindow
// 从工程中替换
private static void ReplaceFromProject(int index)
{
string fromPath = ExportPackPath + "/" + PackConfig[index][1] + "__" + PackConfig[index][2];
string toPath = _MomPackPath + PackConfig[index][2];
string fromPath = ExportPackPath + "/" + PackConfig[index].scene + "__" + PackConfig[index].project;
string toPath = _MomPackPath + PackConfig[index].project;
for (int i = 0; i < ReplaceDir.Length; i++)
{
string dir = ReplaceDir[i];
@ -334,13 +349,13 @@ public class AutoPack : EditorWindow
});
EditorUtility.ClearProgressBar();
}
Debug.Log(PackConfig[index][0] + ":母包工程资源替换完成");
Debug.Log(PackConfig[index].name + ":母包工程资源替换完成");
// 替换build-id
EditorUtility.DisplayProgressBar("重写AndroidManifest", "", 0.5f);
RewriteManifest(fromPath + "/src/main/AndroidManifest.xml", toPath + "/src/main/AndroidManifest.xml");
Debug.Log(PackConfig[index][0] + "母包Manifest修改完成");
Debug.Log(PackConfig[index].name + "母包Manifest修改完成");
EditorUtility.ClearProgressBar();
}
private static void RewriteManifest(string f, string t)
@ -387,7 +402,7 @@ public class AutoPack : EditorWindow
// 从AB包替换
private static void ReplaceFromAB(int index)
{
string toPath = _MomPackPath + PackConfig[index][2] + "/src/main/assets/Android";
string toPath = _MomPackPath + PackConfig[index].project + "/src/main/assets/Android";
if (Directory.Exists(toPath)) Directory.Delete(toPath, true);
Directory.CreateDirectory(toPath);
GameCore.FileUtils.ReplaceDir(ABPath, toPath, (string dirName, string fileName, float progress) =>
@ -395,18 +410,23 @@ public class AutoPack : EditorWindow
EditorUtility.DisplayProgressBar("正在复制:" + dirName, fileName, progress);
});
EditorUtility.ClearProgressBar();
Debug.Log(PackConfig[index][0] + "替换AB包完成");
Debug.Log(PackConfig[index].name + "替换AB包完成");
}
// 替换配置文件
private static void ReplaceConfigAndVersion(int index)
{
EditorUtility.DisplayProgressBar("替换配置文件", "", 0.5f);
string toPath = _MomPackPath + PackConfig[index][2] + "/src/main/assets/Android/";
string fromPath = _MomPackPath + PackConfig[index][2] + "/Config/";
EditorUtility.DisplayProgressBar("替换配置文件1", "", 0.5f);
string fromPath = ClientConfigManager.Instance.GetClientConfigPath() + "/Version/" + PackConfig[index].version + "/";
string toPath = _MomPackPath + PackConfig[index].project + "/Config/";
File.Copy(fromPath + ConfigFileName, toPath + ConfigFileName, true);
File.Copy(fromPath + VersionFileName, toPath + VersionFileName, true);
Debug.Log(PackConfig[index][0]+":配置文件替换完成");
EditorUtility.DisplayProgressBar("替换配置文件2", "", 0.5f);
fromPath = toPath;
toPath = _MomPackPath + PackConfig[index].project + "/src/main/assets/Android/";
File.Copy(fromPath + ConfigFileName, toPath + ConfigFileName, true);
File.Copy(fromPath + VersionFileName, toPath + VersionFileName, true);
Debug.Log(PackConfig[index].name+":配置文件替换完成");
EditorUtility.ClearProgressBar();
}
@ -414,17 +434,17 @@ public class AutoPack : EditorWindow
private static void StartGradleBuild(int index)
{
EditorUtility.DisplayProgressBar("正在生成APK", "", 0f);
GameEditor.Util.ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index][2], "gradlew assembleRelease>>" + APKPath + "/_log.txt");
GameEditor.Util.ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, "gradlew assembleRelease>>" + APKPath + "/_log.txt");
EditorUtility.DisplayProgressBar("正在导出APK", "", 1f);
string versionStr = GetAPKVersionStr(PackConfig[index][2]);
string apkFilePath = _MomPackPath + PackConfig[index][2] + "/build/outputs/apk/release/" + PackConfig[index][2] + "-release.apk";
string versionStr = GetAPKVersionStr(PackConfig[index].project);
string apkFilePath = _MomPackPath + PackConfig[index].project + "/build/outputs/apk/release/" + PackConfig[index].project + "-release.apk";
if (File.Exists(apkFilePath))
{
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk");
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk");
}
Debug.Log(PackConfig[index][0] + ":打包完成");
Debug.Log(PackConfig[index].name + ":打包完成");
EditorUtility.ClearProgressBar();
}
@ -458,17 +478,17 @@ public class AutoPack : EditorWindow
{
if (CommitToGit)
{
string versionStr = GetAPKVersionStr(PackConfig[index][2]);
string versionStr = GetAPKVersionStr(PackConfig[index].project);
EditorUtility.DisplayProgressBar("正在提交修改", "", 0f);
string printlog = ">>" + APKPath + "/_log.txt";
string[] commands = new string[]{
"echo git add ." + printlog,
"git add ." + printlog,
"echo git commit -m 'AutoPack" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git commit -m 'AutoPack" + PackConfig[index][0] +"_"+ PackConfig[index][2] + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"echo git commit -m 'AutoPack" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git commit -m 'AutoPack" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
"git push",
};
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index][2], commands);
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, commands);
EditorUtility.ClearProgressBar();
}

View File

@ -61,6 +61,31 @@ public class ClientConfigManager
return config;
}
// 获取打包工具配置文件
public Hashtable GetAutoPackConfig()
{
string hotfixConfig = localPath + "/AutoPack.txt";
Hashtable config = null;
if (File.Exists(hotfixConfig))
{
string s = File.ReadAllText(hotfixConfig);
config = MiniJSON.jsonDecode(s) as Hashtable;
}
return config;
}
// 获取校验服同步工程配置文件
public Hashtable GetFightServerConfig()
{
string hotfixConfig = localPath + "/FightServer.txt";
Hashtable config = null;
if (File.Exists(hotfixConfig))
{
string s = File.ReadAllText(hotfixConfig);
config = MiniJSON.jsonDecode(s) as Hashtable;
}
return config;
}
// 获取svn工程根目录路径
public string GetClientConfigPath()
{

View File

@ -4799,8 +4799,8 @@ RectTransform:
m_Children:
- {fileID: 1038286848797717324}
- {fileID: 8773250241928916216}
- {fileID: 7192500783854778062}
- {fileID: 9213494320095827108}
- {fileID: 7192500783854778062}
- {fileID: 726478980537134316}
- {fileID: 6787750521099172436}
- {fileID: 4326763871812024314}
@ -5346,8 +5346,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8773970828275836580}
- {fileID: 7802777161117319042}
- {fileID: 8717039602528262249}
- {fileID: 7802777161117319042}
- {fileID: 1473804682652306613}
- {fileID: 6434840553229058696}
m_Father: {fileID: 224353427390833726}
@ -6452,8 +6452,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8773887651407534236}
- {fileID: 5134932089081327844}
- {fileID: 3664213903146751088}
- {fileID: 5134932089081327844}
- {fileID: 841610737445374472}
- {fileID: 8440128951764089854}
m_Father: {fileID: 224353427390833726}
@ -6533,8 +6533,8 @@ RectTransform:
m_Children:
- {fileID: 4916783252602824613}
- {fileID: 8773545490129017070}
- {fileID: 4359432188486531703}
- {fileID: 7370870530407204259}
- {fileID: 4359432188486531703}
- {fileID: 5075066562634089231}
- {fileID: 4772160518092357000}
- {fileID: 767536665978574478}
@ -6700,8 +6700,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224158546098438708}
- {fileID: 2042786427835682893}
- {fileID: 8519913330498722392}
- {fileID: 2042786427835682893}
- {fileID: 5958971747525970482}
- {fileID: 7225922217035970132}
m_Father: {fileID: 224353427390833726}
@ -12277,8 +12277,8 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8773833043905852742}
- {fileID: 4534655569651322158}
- {fileID: 3071424370041062767}
- {fileID: 4534655569651322158}
- {fileID: 3999081153343366784}
- {fileID: 1901042942284068930}
m_Father: {fileID: 224353427390833726}
@ -18034,7 +18034,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224950323983480262}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -42497,7 +42497,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224292030102175808}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -47545,7 +47545,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224737750581944100}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -72351,7 +72351,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224252541779665038}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -72424,7 +72424,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224346343574370934}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -77543,7 +77543,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224346343574370934}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -77735,7 +77735,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224252541779665038}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -126122,7 +126122,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224737750581944100}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -150264,7 +150264,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224292030102175808}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -164762,7 +164762,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224461338842806296}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -174443,7 +174443,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224461338842806296}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -184467,7 +184467,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224950323983480262}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

View File

@ -3961,8 +3961,8 @@ local passivityList = {
table.insert(cl, {v, ct})
end
end
role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill)
atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill)
role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill,atkRole)
atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill,role)
ff = BattleUtil.CountChangeList(ff, cl)
-- 计算分摊伤害
@ -4108,7 +4108,6 @@ local passivityList = {
if maxNum and maxNum > 0 then
cf = cf/maxNum
end
local targets = skill:GetDirectTargets()
if not targets or #targets == 0 then return end
@ -4169,15 +4168,19 @@ local passivityList = {
end)
end,
-- 对敌方造成伤害如被分摊其分摊比降低[a]%
-- a[float]
-- 对敌方造成伤害如被分摊其分摊比降低[a]%,判断类型[b](b:1 普攻 2 技能 3 所有 4燃烧目标 技能 )
-- a[float],b[int]
[196] = function(role, args,id,judge)
local f1 = args[1]
local type = args[2]
local onDamageBeShare = function(func,skill)
local onDamageBeShare = function(func,skill,target)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
end
if type==4 and (not BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return buff.type== BuffName.DOT and buff.damageType==1 end,role,1)
or (skill and (skill.type==BattleSkillType.Normal or skill.type==BattleSkillType.ChaosNormal))) then
return
end
--普攻不会被降低分摊 2020/11/17 wangzhenxing lihaiyang
if type==1 and skill and skill.type~=BattleSkillType.Normal then
return
@ -4288,8 +4291,8 @@ local passivityList = {
table.insert(cl, {v, ct})
end
end
role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill)
atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill)
role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill,atkRole)
atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill,defRole)
ff = BattleUtil.CountChangeList(ff, cl)
local shareDamage = floor(BattleUtil.ErrorCorrection(damage * f1*ff))
-- 被攻击武将自身伤害

View File

@ -327,6 +327,15 @@ end
-- 判断角色是否可以释放技能
function RoleLogic:IsAvailable(skill)
if skill and skill.effectCaster then
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/09/17
--为解决攻击目标只剩被放逐的单位导致我方不放技能扣除怒气
skill.effectCaster:ChooseTarget()
local targets=BattleUtil.LengthOfTable(skill.effectCaster:GetDirectTargetsNoExile())
if targets==0 then
return false
end
end
--角色没有真正死亡 在 被眩晕/沉默的 情况下 任然能释放死亡技能
if (self.ctrl_dizzy or self.ctrl_slient) and self:IsDead() and skill and skill.type==BattleSkillType.DeadSkill then
return true

View File

@ -52,15 +52,6 @@ function Skill:GetOwner()
end
-- 是否可以释放
function Skill:canCastSkill()
if self.effectCaster then
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/03/26
--为解决攻击目标只剩被放逐的单位导致技能播放异常
self.effectCaster:ChooseTarget()
local targets=BattleUtil.LengthOfTable(self:GetDirectTargetsNoExile())
if targets==0 then
return false
end
end
return true
end

View File

@ -461,7 +461,7 @@ function this.BattleEnd(result)
-- 判断是否需要进行结果检测
if this.fightResult then
if result ~= this.fightResult then
BattleRecordManager.SubmitCheckFight(this.fightResult, result)
BattleRecordManager.SubmitCheckFight(result, this.fightResult)
end
end
-- 直接显示结果

View File

@ -213,15 +213,14 @@ function this.GetBaoKuData()
end
end
end
local BasicPoolId = string.split(BlessingConfigNew.BasicPoolId, "#")
--大奖和当前层数数据
for i = 1, 1100 do
if ActInfo.mission[i] then
local v = ActInfo.mission[i]
if v.missionId == 100 then
-- LogYellow("层数:"..v.progress)
actData.curLevel = v.progress
curBasicPool = BlessingConfigNew.BasicPoolId[v.progress]
curBasicPool = tonumber(BasicPoolId[v.progress])
curFinalPool = BlessingConfigNew.FinalPoolId
elseif v.missionId > 1000 then
local data = {}

View File

@ -163,13 +163,13 @@ function this.FightLevelFightBattle(_fightLevelData, callBack)
-- Log("山河社稷图回复战斗 星级 "..msg.stars.." drop "..#msg.drop.itemlist)
HardStageFightResponseMsg = msg
curBattlefightLevelData = _fightLevelData
local result = msg.stars > 0 and 1 or 0
-- local result = msg.stars > 0 and 1 or 0
if _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then
local fightData = BattleManager.GetBattleServerData(msg,0)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FIGHTLEVEL, callBack):SetResult(result)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FIGHTLEVEL, callBack)--:SetResult(result)
elseif _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevel then
local fightData = BattleManager.GetBattleServerData(msg,0)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FIGHT_ASSISTANT_LEVEL, callBack):SetResult(result)
UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FIGHT_ASSISTANT_LEVEL, callBack)--:SetResult(result)
elseif _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevelReward then
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function()
--刷新数据刷新界面

View File

@ -64,21 +64,27 @@ end
--刷新编队数据
function this.UpdateFormation(msg)
Log("编队数量:" .. #msg.TeamPosInfo)
this.formationList = {}
-- this.curFormationIndex = this.SetCurFormationIndex()
this.curFormationIndex = 1
for i, team in ipairs(msg.TeamPosInfo) do
LogGreen("team.teamId:"..team.teamId)
local isRefresh = false
local oTeam = this.MakeAEmptyTeam(team.teamId)
for j = 1, #team.teamHeroInfos do
local teamHeroInfo = team.teamHeroInfos[j]
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
if HeroManager.GetSingleHeroData(teamHeroInfo.heroId) then
table.insert(oTeam.teamHeroInfos, teamHeroInfo)
HeroManager.SetHeroFormationList(teamHeroInfo.heroId,team.teamId,1)
else
isRefresh = true
end
end
oTeam.teamPokemonInfos = {}
this.formationList[team.teamId] = oTeam
if isRefresh then
FormationManager.RefreshFormation(team.teamId, this.formationList[team.teamId].teamHeroInfos, {})
end
end
if #msg.TeamPosInfo == 0 then
@ -205,7 +211,9 @@ function this.GetFormationByID(teamId)
local _v=tonumber(v)
if teamId==_v and #this.formationList[teamId].teamHeroInfos<=0 then
for n = 1, #this.formationList[1].teamHeroInfos do
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
if HeroManager.GetSingleHeroData(this.formationList[1].teamHeroInfos.heroId) then
table.insert(this.formationList[teamId].teamHeroInfos, this.formationList[1].teamHeroInfos[n])
end
end
--
FormationManager.RefreshFormation(teamId, this.formationList[teamId].teamHeroInfos, {})

View File

@ -93,12 +93,12 @@ function GeneralBigPopup:OnOpen(popupKey,...)
this.Mask:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
this.BG:SetActive(popupKey ~= GENERAL_POPUP_TYPE.Onhook)
this.popupKey = popupKey
this.args = ...
this.args = {...}
end
function GeneralBigPopup:OnShow()
contentPrefabs[this.popupKey].gameObject:SetActive(true)
contentScripts[this.popupKey].view:OnShow(this,this.args)--1、传入自己 2、传入不定参
contentScripts[this.popupKey].view:OnShow(this, unpack(this.args))--1、传入自己 2、传入不定参
end
function GeneralBigPopup:OnClose()

View File

@ -62,6 +62,7 @@ function this.Show()
--转起来
resultId = msg.resultId
LogYellow("掉落的Id:"..resultId)
BagManager.GoIntoBackData(msg.drop)
this.test()
--4秒后显示掉落
-- Timer.New(function()

View File

@ -143,6 +143,12 @@ function SurpriseBox:ShowSingleData(item,data,index)
end
Util.AddOnceClick(getBtn,function ()
local actData = CommonActPageManager.GetData(ActivityTypeDef.SurpriseBox)
if not actData then
PopupTipPanel.ShowTip("活动已关闭")
self:ClosePanel()
return
end
if data.progress == 1 then--完成所有条件,可购买
PayManager.Pay(data.otherData.PackId, function(id)
FirstRechargeManager.RefreshAccumRechargeValue(data.otherData.PackId)

View File

@ -1,6 +1,7 @@
using GameCore;
using GameEditor.Util;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -33,10 +34,8 @@ namespace GameEditor.Core.DataConfig
[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");
// 加载配置文件
LoadConfig();
m_CurGitBench = GitUtil.GetCurBenchName();
ServerBattleConfig.TryGetValue(m_CurGitBench, out m_CurServerBattlePath);
@ -52,6 +51,21 @@ namespace GameEditor.Core.DataConfig
win.titleContent = new GUIContent("Export");
win.Show();
}
// 加载配置文件
static void LoadConfig()
{
ServerBattleConfig.Clear();
Hashtable config = ClientConfigManager.Instance.GetFightServerConfig();
foreach (string k in config.Keys)
{
Hashtable ht = config[k] as Hashtable;
string folder = ht["folder"] as string;
string bench = ht["bench"] as string;
XDebug.Log.l(folder, bench);
ServerBattleConfig.Add(bench, folder);
}
}
//提供给打包工具调用的一键导表接口
public static void PyCallBuildData()
{