hch
2025-09-14 249c2184d4e72f2f8a40ac9a156bf54849d0e191
Main/System/Battle/Skill/SkillBase.cs
@@ -4,7 +4,6 @@
using DG.Tweening;
using Spine;
using System.Linq;
using PlasticGui.WorkspaceWindow.BranchExplorer;
public class SkillBase
@@ -117,18 +116,42 @@
         case SkillCastMode.Allies:
            CastToAllies();
            break;
         // case SkillCastMode.DashCast:
         //    DashToTarget(() => BackToOrigin(OnSkillFinished));
         //    break;
         case SkillCastMode.DashCast:
            DashCast(OnAttackFinish);
            break;
         default:
            Debug.LogError("暂时不支持其他的方式释放 有需求请联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillConfig.CastPosition);
            OnSkillFinished();
            Debug.LogError("强制结束技能 暂时不支持其他的方式释放 有需求请联系策划 技能id:" + skillConfig.SkillID + " cast position " + skillConfig.CastPosition);
            ForceFinished();
            break;
      }
   }
   protected void MoveToTarget(RectTransform target, Vector2 offset, float duration, Action onComplete = null)
   //   冲撞攻击
   protected void DashCast(Action _onComplete)
   {
      Debug.LogError("DashCast 还没实现");
      ForceFinished();
      //   YYL TODO
      // var entry = caster.motionBase.PlayAnimation(skillConfig.GetMotionName(), false);
      // float animationTime = entry.AnimationTime;
      // int mainTargetPosNum = BattleUtility.GetMainTargetPositionNum(caster, tagUseSkillAttack.HurtList.ToList(), skillConfig);
      // BattleCamp battleCamp = skillConfig.TagFriendly != 0 ? caster.Camp : caster.GetEnemyCamp();
      // RectTransform targetTrans = battleField.GetTeamNode(battleCamp, mainTargetPosNum);
      // var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, targetTrans, new Vector2(skillConfig.CastDistance, 0), animationTime * 0.9f, () =>
      // {
      //    caster.motionBase.PlayAnimation(MotionName.idle, true);
      //    _onComplete?.Invoke();
      // });
      // battleField.battleTweenMgr.OnPlayTween(tweener);
   }
   protected void MoveToTarget(RectTransform target, Vector2 offset, Action onComplete = null)
   {
      //   原地释放
      if (skillConfig.CastDistance >= 9999)
@@ -138,7 +161,7 @@
      }
      caster.motionBase.PlayAnimation(MotionName.run, true);
      var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, duration, () =>
      var tweener = BattleUtility.MoveToTarget(caster.heroRectTrans, target, offset, () =>
      {
         caster.motionBase.PlayAnimation(MotionName.idle, true);
         onComplete?.Invoke();
@@ -163,7 +186,7 @@
      RectTransform target = battleField.GetTeamNode(caster.GetEnemyCamp(), skillConfig);
      MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), moveTime, () =>
      MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () =>
      {
         //   到位置转身(不一定非要转身 但是流程要写)
         TurnBack(() =>
@@ -175,7 +198,7 @@
                  () =>
                  {
                     //   回到原来的位置
                     MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, moveTime,
                     MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero,
                        OnAttackFinish);
                  }
               , -1f);
@@ -202,7 +225,7 @@
      RectTransform targetTrans = battleField.GetTeamNode(battleCamp, mainTargetPosNum);
      MoveToTarget(targetTrans, new Vector2(skillConfig.CastDistance, 0), moveTime, () =>
      MoveToTarget(targetTrans, new Vector2(skillConfig.CastDistance, 0), () =>
      {
         //   到位置转身(不一定非要转身 但是流程要写)
         TurnBack(() =>
@@ -214,7 +237,7 @@
                  () =>
                  {
                     //   回到原来的位置
                     MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero, moveTime,
                     MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum), Vector2.zero,
                        OnAttackFinish);
                  }
               , -1f);
@@ -232,7 +255,7 @@
   {
      RectTransform target = battleField.GetTeamNode(caster.Camp, skillConfig);
      MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), moveTime, () =>
      MoveToTarget(target, new Vector2(skillConfig.CastDistance, 0), () =>
      {
         //   到位置转身(不一定非要转身 但是流程要写)
         TurnBack(() =>
@@ -245,7 +268,7 @@
                  {
                     //   回到原来的位置
                     MoveToTarget(battleField.GetTeamNode(caster.Camp, caster.teamHero.positionNum),
                        Vector2.zero, moveTime, OnAttackFinish);
                        Vector2.zero, OnAttackFinish);
                  }
               , -1f);
            });
@@ -588,6 +611,7 @@
   {
      skillEffect?.ForceFinished();
      isFinished = true;
      moveFinished = true;
      while (packList.Count > 0)
      {