From 2219757becd9d65e3145587c2ef7cc4f6437dda2 Mon Sep 17 00:00:00 2001 From: "DESKTOP-SAJ6RKV\\Administrator" Date: Sat, 28 Jun 2025 18:35:19 +0800 Subject: [PATCH] 1 --- .../HotFix/GameLogic/Common/EventConts.cs | 4 ++- .../GameLogic/Manager/DataGameSceneManager.cs | 2 ++ .../HotFix/GameLogic/UI/UIGameBattle.cs | 32 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs index b6e641c4..f1c8836e 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs @@ -16,7 +16,7 @@ namespace GameLogic public static string GmPass = ConfigSystem.Instance.Tables.TbSystemConfig.Get(1).GmPassworld; // Gm解锁密码 public static float JszPower = ConfigSystem.Instance.Tables.TbSystemConfig.Get(1).JszPower; // Gm解锁密码 public static float WaiXingScale = ConfigSystem.Instance.Tables.TbSystemConfig.Get(1).WaiXingScale; - public static float WaiXingBeiLv = ConfigSystem.Instance.Tables.TbSystemConfig.Get(1).WaiXingBeiLv; + public static float WaiXingBeiLv = ConfigSystem.Instance.Tables.TbSystemConfig.Get(1).WaiXingBeiLv; public static bool isGmPass = false; // 是否解锁 public const int isZoneTimerBuffId = 6;// 特殊Buff public const int isAllPowerBuffId = 7;// 永久增加Buff @@ -82,6 +82,8 @@ namespace GameLogic public const string GuanJunShiKe = "GuanJunShiKe"; public const string UIDianZan = "UIDianZan"; public const string UIHDWMSP = "UIHDWMSP"; + + public const string UIDouDong = "UIDouDong"; #endregion diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs index b88cfb64..4eae7e18 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs @@ -887,6 +887,7 @@ namespace GameLogic //hItemActors[1].actor.SetCurrenFill(); targetActor.m_AllPush -= (int)(EventConts.JszPower * 10); targetActor.SetCurrenFill(); + GameEvent.Send(EventConts.UIDouDong); //eGo.transform.parent.parent.parent.parent.GetComponent().SetCurrenFill(); }); } @@ -913,6 +914,7 @@ namespace GameLogic //targetActor.m_AllPush -= EventConts.JszPower; targetActor.m_AllPush -= (int)(EventConts.JszPower * 10); targetActor.SetCurrenFill(); + GameEvent.Send(EventConts.UIDouDong); //eGo.transform.parent.parent.parent.parent.GetComponent().SetCurrenFill(); }); diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameBattle.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameBattle.cs index 28847f6d..66147bd3 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameBattle.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameBattle.cs @@ -319,6 +319,7 @@ namespace GameLogic GameEvent.AddEventListener(EventConts.UIDianZan, UIDianZanFunc); GameEvent.AddEventListener(EventConts.UIHDWMSP, AddHdWmspFunc); GameEvent.AddEventListener(EventConts.AddGiftMessage, AddGiftMessageFunc); + GameEvent.AddEventListener(EventConts.UIDouDong, UIDouDongFunc); } @@ -334,12 +335,43 @@ namespace GameLogic GameEvent.RemoveEventListener(EventConts.UIDianZan, UIDianZanFunc); GameEvent.RemoveEventListener(EventConts.UIHDWMSP, AddHdWmspFunc); GameEvent.RemoveEventListener(EventConts.AddGiftMessage, AddGiftMessageFunc); + GameEvent.RemoveEventListener(EventConts.UIDouDong, UIDouDongFunc); // 主界面销毁的时候应该停止所有 GameModule.Timer.RemoveTimer(m_LishiId); } + bool isShaking = false; + + + private void UIDouDongFunc() + { + if (isShaking) return; // 抖动过程中不能再次进入 + var rect = this.gameObject.GetComponent(); + if (rect != null) + { + ShakeRectTransformSequence(rect); + } + } + + private void ShakeRectTransformSequence(RectTransform rect) + { + isShaking = true; + Sequence seq = DOTween.Sequence(); + for (int i = 0; i < 10; i++) + { + float duration = UnityEngine.Random.Range(0.08f, 0.15f); + float strength = UnityEngine.Random.Range(20f, 40f); + int vibrato = UnityEngine.Random.Range(8, 14); + float randomness = UnityEngine.Random.Range(80f, 120f); + + // 每次抖动后加一个AppendInterval,保证有序 + seq.Append(rect.DOShakePosition(duration, strength, vibrato, randomness, false, true)); + } + seq.OnComplete(() => isShaking = false); + } + private void UIDianZanFunc(string nickName) { CreateWidgetByPrefab(m_rect_Dz.gameObject).OnInit(nickName);