From 6bc8a17ed56027c54cdd523dda04a049f5e2e8dd Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 21 一月 2026 10:40:54 +0800
Subject: [PATCH] 125 战斗 修复战斗卡死问题 并移除了子技能的设计 只有内嵌技能

---
 Main/System/Battle/RecordPlayer/RecordPlayer.cs |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Main/System/Battle/RecordPlayer/RecordPlayer.cs b/Main/System/Battle/RecordPlayer/RecordPlayer.cs
index a5da9c6..68311a4 100644
--- a/Main/System/Battle/RecordPlayer/RecordPlayer.cs
+++ b/Main/System/Battle/RecordPlayer/RecordPlayer.cs
@@ -43,6 +43,7 @@
     public void PlayRecord(RecordAction recordAction)
     {
         if (recordAction == null) return;
+        recordAction.actionOwner = this;
         // Debug.LogError("Enqueue record action " + recordAction.GetType() + " to queue");
         if (isForceFinish || stepForcefinish)
         {
@@ -50,6 +51,7 @@
             return;
         }
         recordActionQueue.Enqueue(recordAction);
+        recordAction.AfterAddToQueue();
     }
 
     public void PlayRecord(List<RecordAction> recordActions)
@@ -60,9 +62,10 @@
         }
     }
 
-    public void InsertRecord(RecordAction recordAction)
+    public void InsertRecord(RecordAction recordAction, int position = 0)
     {
         if (recordAction == null) return;
+        recordAction.actionOwner = this;
         if (isForceFinish || stepForcefinish)
         {
             recordAction.ForceFinish();
@@ -73,22 +76,33 @@
         if (currentRecordAction != null)
         {
             Queue<RecordAction> tempQueue = new Queue<RecordAction>();
+
+            for (int i = 0; i < position && recordActionQueue.Count > 0; i++)
+            {
+                tempQueue.Enqueue(recordActionQueue.Dequeue());
+            }
+
             tempQueue.Enqueue(recordAction);
+
             while (recordActionQueue.Count > 0)
             {
                 tempQueue.Enqueue(recordActionQueue.Dequeue());
             }
+            
             recordActionQueue = tempQueue;
         }
         else
         {
             recordActionQueue.Enqueue(recordAction);
         }
+
+        recordAction.AfterAddToQueue();
     }
 
     public void ImmediatelyPlay(RecordAction recordAction)
     {
         if (recordAction == null) return;
+        recordAction.actionOwner = this;
         if (isForceFinish || stepForcefinish)
         {
             recordAction.ForceFinish();
@@ -101,6 +115,7 @@
     public void ImmediatelyPlay(RecordAction recordAction, RecordAction parentAction, bool isWaitingPlay)
     {
         if (recordAction == null) return;
+        recordAction.actionOwner = this;
         if (isForceFinish || stepForcefinish)
         {
             recordAction.ForceFinish();
@@ -238,7 +253,16 @@
             if (recordActionQueue.Count > 0)
             {
                 currentRecordAction = recordActionQueue.Dequeue();
-                // BattleDebug.LogError("play record action " + currentRecordAction.GetType());
+                #if UNITY_EDITOR
+                // if (currentRecordAction is SkillRecordAction skillRecordAction)
+                // {
+                //     Debug.LogError("RecordPlayer Run Play SkillRecordAction skillname " + skillRecordAction.skillBase.skillConfig.SkillName + " caster " + skillRecordAction.skillBase.caster.teamHero.name);
+                // }
+                // else
+                #endif
+                {
+                    BattleDebug.LogError("play record action " + currentRecordAction.GetType());
+                }
             }
         }
     }

--
Gitblit v1.8.0