From 8581fb56f1bc0ad0c396a9f689be14e94e6ca00b Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期日, 28 九月 2025 19:57:19 +0800
Subject: [PATCH] 125 战斗 1.战斗层级无效问题 2.连击不回原位就直接开打的问题 3.特效延迟销毁问题 4.部分技能使用之后会卡死的问题

---
 Main/System/Battle/Skill/SkillBase.cs |   40 ++++++++++++++++++++++++----------------
 1 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/Main/System/Battle/Skill/SkillBase.cs b/Main/System/Battle/Skill/SkillBase.cs
index 232a5ea..ed22592 100644
--- a/Main/System/Battle/Skill/SkillBase.cs
+++ b/Main/System/Battle/Skill/SkillBase.cs
@@ -50,7 +50,7 @@
 		battleField = _battleField;
 		packList = _packList;
 
-
+		// Debug.LogError("start a skill id " + skillConfig.SkillID + " caster " + caster.teamHero.heroId + " pos " + caster.teamHero.positionNum + " camp " + caster.Camp);
 
 	}
 
@@ -79,7 +79,10 @@
 			}
 			else
 			{
-				otherSkillAction.Run();
+				if (moveFinished)
+				{
+					otherSkillAction.Run();
+				}
 			}
 			return;
 		}
@@ -89,6 +92,7 @@
 	// 1路绉诲姩鍒拌窛绂婚樀瀹逛綅缃畁鐮佺殑璺濈锛堝2鍙蜂綅锛�5鍙蜂綅锛夐噴鏀撅紙鍗虫垬鍦轰腑澶绫伙級
 	public virtual void Cast()
 	{
+		// Debug.LogError("Cast skill " + skillConfig.SkillID + " cast position " + skillConfig.CastPosition + " cast mode " + skillConfig.castMode); 
 		string guid = battleField.guid;
 		TeamHero teamHero = caster.teamHero;
 		EventBroadcast.Instance.Broadcast<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, guid, skillConfig, teamHero);
@@ -162,6 +166,8 @@
 			_onComplete?.Invoke();
 		}, speed);
 		battleField.battleTweenMgr.OnPlayTween(tweener);
+
+		// Debug.LogError("move to tarrget " + target.name + " offset " + offset + " speed " + speed + " time " + tweener.Duration());
 	}
 
 	protected void TurnBack(Action _onComplete, float forward)
@@ -244,6 +250,16 @@
 	protected virtual void OnAllAttackMoveFinished()
 	{
 		moveFinished = true;
+		List<BattleObject> allList = battleField.battleObjMgr.allBattleObjDict.Values.ToList<BattleObject>();
+		for (int i = 0; i < allList.Count; i++)
+		{
+			BattleObject bo = allList[i];
+			bo.layerMgr.SetFront();
+			// bo.heroRectTrans.SetParent(battleField.GetTeamNode(bo.Camp, bo.teamHero.positionNum), true);
+			bo.heroInfoBar.SetActive(true);
+		}
+		battleField.battleRootNode.skillMaskNode.SetActive(false);
+		// Debug.LogError("OnAllAttackMoveFinished skill " + skillConfig.SkillID + " cast position " + skillConfig.CastPosition + " cast mode " + skillConfig.castMode); 
 	}
 
 	protected void CastToAllies()
@@ -365,6 +381,8 @@
 
 		caster.heroInfoBar.SetActive(false);
 
+		
+
 		for (int i = 0; i < allList.Count; i++)
 		{
 			BattleObject bo = allList[i];
@@ -372,12 +390,12 @@
 			{
 				bo.layerMgr.SetFront();
 				bo.heroInfoBar.SetActive(true);
-				bo.heroRectTrans.SetParent(battleField.battleRootNode.skillFrontNode, true);
+				// bo.heroRectTrans.SetParent(battleField.battleRootNode.skillFrontNode, true);
 			}
 			else
 			{
 				bo.layerMgr.SetBack();
-				bo.heroRectTrans.SetParent(battleField.battleRootNode.skillBackNode, true);
+				// bo.heroRectTrans.SetParent(battleField.battleRootNode.skillBackNode, true);
 			}
 
 			if (targetList.Contains(bo))
@@ -393,7 +411,7 @@
 		caster.layerMgr.SetSortingOrder(BattleConst.ActiveHeroActionSortingOrder);
 
 		battleField.battleRootNode.skillMaskNode.SetActive(true);
-
+		battleField.battleRootNode.SetSortingOrder();
 		// caster.battleField.skillMask
 		//	鎶婅繖浜汢O鍏ㄩ珮浜� 鎴栬�呰鎶婇櫎浜嗚繖浜涚殑閮芥斁鍦ㄩ伄缃╁悗闈�
 		//	YYL TODO
@@ -646,23 +664,13 @@
 
 		if (isFinished && moveFinished)
 		{
-			List<BattleObject> allList = battleField.battleObjMgr.allBattleObjDict.Values.ToList<BattleObject>();
-			for (int i = 0; i < allList.Count; i++)
-			{
-				BattleObject bo = allList[i];
-				bo.layerMgr.SetFront();
-				bo.heroRectTrans.SetParent(battleField.GetTeamNode(bo.Camp, bo.teamHero.positionNum), true);
-				bo.heroInfoBar.SetActive(true);
-			}
-			battleField.battleRootNode.skillMaskNode.SetActive(false);
-
 			if (packList.Count > 0)
 			{
 				OnSkillFinished();
 				return false;
 			}
 
-			return packList.Count <= 0;
+			return true;
 		}
 		else
 		{

--
Gitblit v1.8.0