yyl
2026-01-21 6bc8a17ed56027c54cdd523dda04a049f5e2e8dd
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());
                }
            }
        }
    }