From 7124d5404ae57ed56548ec8186ea038a0cb85e2e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 22 十二月 2025 19:07:21 +0800
Subject: [PATCH] 125 战斗 修复吕玲绮动作卡死的问题 带着特效控制特效攻击的问题
---
Main/System/Battle/Motion/MotionBase.cs | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/Main/System/Battle/Motion/MotionBase.cs b/Main/System/Battle/Motion/MotionBase.cs
index 301e75a..4f60ec5 100644
--- a/Main/System/Battle/Motion/MotionBase.cs
+++ b/Main/System/Battle/Motion/MotionBase.cs
@@ -108,8 +108,6 @@
public virtual Spine.TrackEntry PlayDeadAnimation(Action onComplete = null)
{
if (animState == null) return null;
-
- CancelControledAnimation();
// 浣跨敤杞ㄩ亾9浣滀负姝讳骸鍔ㄧ敾涓撶敤杞ㄩ亾锛堢嫭绔嬩簬涓昏建閬�0鍜屽瓙鎶�鑳借建閬�1-8锛�
const int deathTrackIndex = 9;
@@ -401,11 +399,17 @@
{
finalEnded = true;
- // 娓呯悊鎶�鑳借建閬�
+ // 娓呯悊鎶�鑳借建閬� - 浠庡瓧鍏镐腑绉婚櫎
if (skillTrack != null && activeSkillTracks.ContainsKey(trackIndex))
{
if (activeSkillTracks[trackIndex] == skillTrack)
activeSkillTracks.Remove(trackIndex);
+ }
+
+ // 銆愬叧閿慨澶嶃�戞竻闄� animState 涓殑杞ㄩ亾锛岄槻姝㈤珮缂栧彿杞ㄩ亾鐨勬渶鍚庝竴甯ц鐩栦綆缂栧彿杞ㄩ亾
+ if (trackIndex > 0)
+ {
+ animState?.ClearTrack(trackIndex);
}
// 鍥炴敹瀛愭妧鑳借建閬�
@@ -494,6 +498,14 @@
// 杩欓噷鏄彈鍒扮‖鎺ф椂鍊� 闇�瑕佽〃鐜扮殑鍔ㄧ敾
var entry = PlayAnimation(MotionName.hit, false);
+
+ if (entry == null)
+ {
+ // playingSkillAnim || animState == null
+ Debug.LogError("SetControledAnimation PlayAnimation hit failed : reason : " + (playingSkillAnim ? "playingSkillAnim" : "animState == null"));
+ return;
+ }
+
float threeFrameTrackTime = 3f / BattleConst.skillMotionFps;
entry.TrackTime = threeFrameTrackTime;
entry.TimeScale = 0;
@@ -506,7 +518,18 @@
{
// 纭帶缁撴潫锛屾仮澶嶅姩鐢绘挱鏀�
isUnderControl = false;
- PlayAnimation(MotionName.idle, true);
+
+ // 鎭㈠鎵�鏈夎建閬撶殑鏃堕棿缂╂斁
+ foreach (var key in animState.Tracks)
+ {
+ if (key != null)
+ key.TimeScale = 1f;
+ }
+
+ // 閲嶇疆楠ㄩ鍒板垵濮嬪Э鎬侊紝闃叉 hit 鍔ㄧ敾鐨勫Э鎬佹畫鐣�
+ skeleton?.SetToSetupPose();
+
+ var entry = PlayAnimation(MotionName.idle, true);
}
public virtual void Run()
--
Gitblit v1.8.0