From a49132dd5d0f7ca635c05460cd02969853199b2b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 29 一月 2026 18:20:59 +0800
Subject: [PATCH] 64 【命格】自动推演问题 - 特效加速
---
Main/System/Mingge/MinggeWin.cs | 2 +-
Main/System/Mingge/MinggeManager.cs | 34 ++++++++++++++++++++++++++++++----
Main/Component/UI/Effect/EffectPlayer.cs | 16 +++++++++++++---
3 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/Main/Component/UI/Effect/EffectPlayer.cs b/Main/Component/UI/Effect/EffectPlayer.cs
index 661b4e5..e12dbe3 100644
--- a/Main/Component/UI/Effect/EffectPlayer.cs
+++ b/Main/Component/UI/Effect/EffectPlayer.cs
@@ -35,7 +35,7 @@
public EffectConfig effectConfig;
- public float speedRate = 1f;
+ public float speedRate = 1f; //鍒濆鍖栫殑鏃跺�欑敤 淇敼浣跨敤SetSpeed
[Header("鏄惁寰幆鎾斁spine鐗规晥")]
public bool isPlaySpineLoop = false;
@@ -249,7 +249,17 @@
// return;
// }
-
+ //瓒婂ぇ瓒婂揩
+ public void SetSpeed(float speed)
+ {
+ speedRate = speed;
+ if (spineAnimationState == null)
+ {
+ Debug.LogError("spineAnimationState is null 鍙互鍏堣皟鐢╬lay");
+ return;
+ }
+ spineAnimationState.TimeScale = speed;
+ }
protected void PlaySpineEffect(bool closePMA = false)
{
@@ -268,7 +278,6 @@
spineComp.MeshGenerator.settings.pmaVertexColors = !closePMA;
spineComp.raycastTarget = false;
spineComp.Initialize(true);
- spineComp.timeScale = speedRate;
// 妫�鏌ュ姩鐢绘槸鍚︽湁鐩稿姞妯″紡
// bool hasAdditiveBlend = CheckForAdditiveBlend(spineComp.Skeleton);
// if (hasAdditiveBlend)
@@ -282,6 +291,7 @@
spineComp.material = ResManager.Instance.LoadAsset<Material>("Materials", "SkeletonGraphicDefault-Straight");
spineAnimationState = spineComp.AnimationState;
+ spineAnimationState.TimeScale = speedRate;
spineAnimationState.Data.DefaultMix = 0f;
spineAnimationState.Complete -= OnSpineAnimationComplete;
spineAnimationState.Complete += OnSpineAnimationComplete;
diff --git a/Main/System/Mingge/MinggeManager.cs b/Main/System/Mingge/MinggeManager.cs
index c48f44e..b725b6d 100644
--- a/Main/System/Mingge/MinggeManager.cs
+++ b/Main/System/Mingge/MinggeManager.cs
@@ -94,6 +94,7 @@
isStartAuto = false;
isPauseAuto = false;
qlNotNotify = false;
+ decomposeMGList.Clear();
}
private void OnBeforePlayerDataInitialize()
@@ -155,10 +156,22 @@
if (OpenMinggeEquipWin(item))
{
//闇�瑕佺帺瀹跺鐞嗚澶�
+ if (!decomposeMGList.IsNullOrEmpty())
+ {
+ SendDecompose(decomposeMGList.ToArray());
+ decomposeMGList.Clear();
+ }
+
return true;
}
}
+ //闇�瑕佺帺瀹跺鐞嗚澶�
+ if (!decomposeMGList.IsNullOrEmpty())
+ {
+ SendDecompose(decomposeMGList.ToArray());
+ decomposeMGList.Clear();
+ }
return false;
}
@@ -534,6 +547,7 @@
{
m_IsStartAuto = value;
isPauseAuto = false;
+ decomposeMGList.Clear();
UpdateRedPoint();
ChangeAutoEvent?.Invoke();
}
@@ -668,9 +682,21 @@
}
}
- SendDecompose(new byte[] { (byte)mgEquip.gridIndex });
+ // SendDecompose(new byte[] { (byte)mgEquip.gridIndex });
+ AddDecomposeMG((byte)mgEquip.gridIndex);
return false;
}
+
+ List<byte> decomposeMGList = new List<byte>();
+ void AddDecomposeMG(byte index)
+ {
+ if (decomposeMGList.Contains(index))
+ {
+ return;
+ }
+ decomposeMGList.Add(index);
+ }
+
//鍗曟柟妗堝垽鏂紝鏈紑鍚殑涔熷綋浣滃彲鍒嗚В锛屽灞傚濂楀垽鏂湁涓�濂楅渶瑕佸氨鏄渶瑕佺┛鎴�
bool CanDecomposeMG(ItemModel mgEquip, MinggeAutoSet autoSet)
@@ -864,15 +890,15 @@
if (!ui.tyEffect.isPlaying)
{
ui.tyEffect.onComplete = null;
+ ui.tyEffect.Play();
if (autoSpeedUP)
{
- ui.tyEffect.speedRate = autoTYCDs[0] / autoTYCDs[1];
+ ui.tyEffect.SetSpeed(autoTYCDs[0] / autoTYCDs[1]);
}
else
{
- ui.tyEffect.speedRate = 1;
+ ui.tyEffect.SetSpeed(1);
}
- ui.tyEffect.Play();
}
}
diff --git a/Main/System/Mingge/MinggeWin.cs b/Main/System/Mingge/MinggeWin.cs
index b5e2336..4666102 100644
--- a/Main/System/Mingge/MinggeWin.cs
+++ b/Main/System/Mingge/MinggeWin.cs
@@ -297,12 +297,12 @@
{
MinggeManager.Instance.StartAuto(false);
}
- tyEffect.speedRate = 1;
tyEffect.onComplete = () =>
{
MinggeManager.Instance.SendTY(1);
};
tyEffect.Play();
+ tyEffect.SetSpeed(1);
}
--
Gitblit v1.8.0