This commit is contained in:
2026-10-12 16:03:34 +08:00
parent f64642a4c5
commit c1c5f05d3f
5 changed files with 210 additions and 10 deletions
+153 -9
View File
@@ -2171,7 +2171,25 @@ MonoBehaviour:
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2231,7 +2249,25 @@ MonoBehaviour:
m_BlendOutDuration: 0
m_MixInCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2336,7 +2372,25 @@ MonoBehaviour:
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2528,7 +2582,25 @@ MonoBehaviour:
m_BlendOutDuration: 0
m_MixInCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2594,13 +2666,49 @@ MonoBehaviour:
m_BlendOutDuration: 1.3333333333333286
m_MixInCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2627,13 +2735,49 @@ MonoBehaviour:
m_BlendOutDuration: 1.3166666666666345
m_MixInCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
m_MixOutCurve:
serializedVersion: 2
m_Curve: []
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
@@ -2714,7 +2858,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 15c38f6fa1940124db1ab7f6fe7268d1, type: 3}
m_Name: Signal Emitter
m_EditorClassIdentifier:
m_Time: 117.93333333333335
m_Time: 120.30000000000004
m_Retroactive: 0
m_EmitOnce: 0
m_Asset: {fileID: 11400000, guid: aca498d52b11314418047bc8d6c097ae, type: 2}
+3 -1
View File
@@ -3876,9 +3876,11 @@ MonoBehaviour:
m_EditorClassIdentifier:
config: {fileID: 11400000, guid: f2f67348a5eb9f3449b426fec5d2fd12, type: 2}
uiRoot: {fileID: 1096182889}
obj_JiaZaiZhong: {fileID: 0}
obj_JiaZaiZhong: {fileID: 4264627302849353753, guid: 021ede141bc7c4e47bcf4fabed7681d6,
type: 3}
loadPanel: {fileID: 2258378551980177528, guid: 953c7fd5628fa1d418bac4e4aa6c8ea4,
type: 3}
jiaZaiZhongDelay: 0.1
BoardPanelParefab: {fileID: 2654078965480511721, guid: aff715af8514eca42972496e4c2232c3,
type: 3}
BoardPanelParefabGongGao: {fileID: 2654078965480511721, guid: 5b9fb25eac1f838459fe9492f6c8a242,
@@ -278,7 +278,43 @@ public class FlyTurretData : TurretData
// 飞行/悬停期间拦截状态动画(Attack/Idle 切换不打断起飞动画)
if (IsFlying) return;
if (newState == TurretState.Attack)
{
// ⭐ XJMH 原版射击动画(Battery:Shoot):**每发** SetAnimation(0,"shot",false)——从头重播(连射时
// 直接打断重放=原版"播放一半直接重新放")、非循环播完停住。
// 基类是"进入状态播一次 + 循环播放",连射不重播 → 这里每次 Attack 都重播。
// 首次进入先走基类同步状态(基类循环版动画同帧被下面重播覆盖,玩家不可见)
if (CurrState != TurretState.Attack)
base.ChangeState(newState);
PlayShotAnim();
return;
}
base.ChangeState(newState);
}
/// <summary>⚠ 覆写:XJMH 停火不打断最后一发(原版最后一发播完自动切待机=定格在尾帧,见基类说明)</summary>
protected override bool KeepPoseOnEmptyIdleAnim => true;
/// <summary>同一帧内去重:自动开火"状态切换 + 手动发射"两条入口可能同帧都调本方法</summary>
private int _lastShotFrame = -1;
/// <summary>
/// 播放一发射击动画(原版 Battery:Shoot → gunSkeleton SetAnimation(0,"shot",false)):
/// ⭐ 每发从头重播(连射时打断当前播放重新开始);非循环,播完停在尾帧等下一发。
/// 手动按住扫射的每发(不经过 ChangeState)由 GameMainPanel 在发射后调用;飞行中不播(原版 isPlaneState 时跳过)。
/// </summary>
public void PlayShotAnim()
{
if (IsFlying) return;
if (_lastShotFrame == Time.frameCount) return; // 同一帧重复调用只播一次
_lastShotFrame = Time.frameCount;
if (skeletonAnimation == null || skeletonAnimation.AnimationState == null) return;
string anim = string.IsNullOrEmpty(attackAnim) ? "shot" : attackAnim;
if (!HasSpineAnim(skeletonAnimation, anim)) return;
skeletonAnimation.AnimationState.SetAnimation(0, anim, false); // 每发从头(替换轨道=打断重放)
}
// ==================== XJMH 进房入场动画(原版 Battery:EnterAction,进入房间时本地座位播一次) ====================
@@ -303,6 +303,10 @@ public class TurretData : MonoBehaviour
PlayState(newState);
}
/// <summary>Idle 且没有配置待机动画时,是否保留当前姿态(不清轨道)。默认 false=清轨道(旧行为);
/// XJMH(FlyTurretData)覆写 true:停火不打断射击动画,最后一发播完自然停住(原版行为)。</summary>
protected virtual bool KeepPoseOnEmptyIdleAnim => false;
/// <summary>
/// 播放"出现动画":各 SkeletonGraphic 上配置的 Spine startingAnimation(炮台容器/炮体上配的是 out、trans 等)。
/// ⭐ Spine 只在 Awake(第一次激活)应用一次 startingAnimation,而 OnEnable 的 PlayState(Idle)
@@ -419,6 +423,15 @@ public class TurretData : MonoBehaviour
// 而 idleAnim 为空正好走这个分支,出现动画一帧就被清掉。
if (Time.time < _appearAnimHoldUntil) return;
// ⭐ XJMH:停火不打断最后一发——射击动画还在播时先不清轨道,让它播完自然停住
// (原版 Battery:Shoot 每发 SetAnimation(0,"shot",false),停止开火后不再重播、自然播完)
if (KeepPoseOnEmptyIdleAnim && !string.IsNullOrEmpty(attackAnim))
{
var cur = skeletonAnimation.AnimationState.GetCurrent(0);
if (cur != null && !cur.IsComplete && cur.Animation != null && cur.Animation.Name == attackAnim)
return;
}
skeletonAnimation.AnimationState.ClearTrack(0);
skeletonAnimation.AnimationState.SetEmptyAnimation(0, 0f);
return;
@@ -3582,6 +3582,11 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
//FireBullet(currSitData, angle, isSanShe, isDouble, isLock);
SyncFire(angle, isSanShe, isDouble, isLock);
// ⭐ XJMH 起飞炮台:手动按住扫射的**每发**也重播射击动画(原版 Battery:Shoot 每发重播)。
// 自动开火路径每发会走 ChangeState(Attack)(内部已重播),这里兜住手动路径(同帧自动去重)
if (currSitData != null && currSitData.currentTurret is FlyTurretData flyShot)
flyShot.PlayShotAnim();
}
// ==================== 起飞炮台(FlyTurretData) ====================