From fa6214375da2eb67a7db7e9b019485a71565fa1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A3=AE2003?= <2384017988@qq.com> Date: Fri, 2 Oct 2026 17:29:47 +0800 Subject: [PATCH] 1 --- .../Windows/addressables_content_state.bin | Bin 4130 -> 4130 bytes .../aa/UI/Game/XJMH/GameMainPanelXJMH.prefab | 6 +- .../aa/UI/Game/XJMH/GameMainPanel_XJMH.cs | 13 ++++ .../aa/UI/Game/XJMH/GoldColumnController.cs | 58 +++++++++++++----- 4 files changed, 58 insertions(+), 19 deletions(-) diff --git a/Assets/AddressableAssetsData/Windows/addressables_content_state.bin b/Assets/AddressableAssetsData/Windows/addressables_content_state.bin index 7b2c07eb02efc339348cc34534770b28b325dfd8..48342970b098420447aa030055baa3834899d23d 100644 GIT binary patch delta 859 zcmaixyK7WI7{#+*b~m!_ZX*W7#}zJu-Mk-#%W5Mbl|jLvh4alf1O5qGte~={i3kG< zHj#j6un|%SDN+Q)e?Tl0L}DQpYLQA5adu&C?=TM-=KO|p&PKUWzPeSE4ngT)2tn$i z3=SwrsU)+;yTG;EdQvPkN`}-#X_m_DgYBtBEq#ijiBt}z3Nxt_e z6#z)k#0H*THb-S(f@g*kifbVpcosF2(h18n$KcXpYg8(yJVBt=T5TPP5N+gy8j`V^ z2uNRBw@Vq6vkJ7;-UKNkNI@~E7zpqcs=yG_?)=SCDr+z@X?&Cse8{$__QFUDNEnSs=7F# zd+AXS1qH_RhzXT%ZTk8 z?+#?a6mcw{Qv{zN>RMS|**TN0cZY+gJAXPe#EBU~O%QdRUHHbT^r<^679Si*r+N!j zU4Ofm_m|SO-mv(5_Ip~-g1RoB?ftx)K4ii8?Q%NaU#RMO{cSd1q$~a5;LY><|6QG) bxjH{_RoD8LN55XD_x*F7mG%658g1tvKo9Ta delta 859 zcmaixKWNl36vsV}yI%SAdW%>PwGmDcT=Msq1myVXCW4b-K|z!El1ZdP7adL!Ia~@t z1i?Y2x)cWs9o?LqI#?*;AXLTbku*|^sxKCpl^ctKT^ z7E8$uwW4HR0B6pZo6p;qTLg?mVbBXB5Tlh2Xmn7^tLl5+@rNSt)|bFAS^)+`K;fxHW7V z=i;M(H`7e9+OBrrr)S0buxYZNzTdf;aIPBd{5an`lvgY7V>uqlr%UtIIQQGz%YW0i zj5xdd`EX7+KpfBU03m8blPkaA=T^GauSUP$oSvH^PEHYJjcD@h_15B*^tE5L`{lWG zYJOqZf6~jG(B$RPy9d|Omz?lqe>I&LEDW1`bt{8OS{hWNr?62> dRh^ltx>&1fa{b}#_KUPLxKOOWssZ(Ai~qiR?GOL} diff --git a/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanelXJMH.prefab b/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanelXJMH.prefab index fc0825bf2..3f37e7394 100644 --- a/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanelXJMH.prefab +++ b/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanelXJMH.prefab @@ -15028,7 +15028,7 @@ PrefabInstance: - target: {fileID: 3429558903206714841, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3783151213167614958, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} @@ -15038,7 +15038,7 @@ PrefabInstance: - target: {fileID: 3783151213167614958, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 6114408877341087527, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} @@ -15173,7 +15173,7 @@ PrefabInstance: - target: {fileID: 7125234996501131867, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 7125234996501131867, guid: 6c8512965de208f498306fbdfeb8eb5b, type: 3} diff --git a/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanel_XJMH.cs b/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanel_XJMH.cs index 330cc6c80..952d0d0d2 100644 --- a/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanel_XJMH.cs +++ b/Assets/MyGame/aa/UI/Game/XJMH/GameMainPanel_XJMH.cs @@ -21,6 +21,14 @@ public class GameMainPanel_XJMH : GameMainPanel_FishBase public GoldColumnController goldColumnController; private GoldColumnController _goldColumn; + [Header("金币柱位置(面板上实时调,每次出柱生效)")] + [Tooltip("首柱相对座位的 X 偏移(以此处为准,控制器组件上的同名字段会被覆盖)")] + public float goldColumnOffsetX = 150f; + [Tooltip("相邻金币柱的 X 间距")] + public float goldColumnDeltaX = 40f; + [Tooltip("金币柱 Y(相对面板底边,0=贴着底边往上长)")] + public float goldColumnOffsetY = 0f; + public override void Awake() { base.Awake(); @@ -111,6 +119,11 @@ public class GameMainPanel_XJMH : GameMainPanel_FishBase _goldColumn.Init(transform as RectTransform); } + // ⭐ 位置参数以面板上的字段为准(每次出柱前同步,Play 模式下改完立即生效) + _goldColumn.offsetX = goldColumnOffsetX; + _goldColumn.deltaX = goldColumnDeltaX; + _goldColumn.offsetY = goldColumnOffsetY; + bool isSelf = currSitData != null && sit == currSitData; _goldColumn.ShowOne(sit, earn, isSelf); } diff --git a/Assets/MyGame/aa/UI/Game/XJMH/GoldColumnController.cs b/Assets/MyGame/aa/UI/Game/XJMH/GoldColumnController.cs index 6e997c73d..0200f8e04 100644 --- a/Assets/MyGame/aa/UI/Game/XJMH/GoldColumnController.cs +++ b/Assets/MyGame/aa/UI/Game/XJMH/GoldColumnController.cs @@ -108,7 +108,7 @@ public class GoldColumnController : MonoBehaviour _selfTemplate = FindChildByName(_panelRoot, selfTemplateName)?.gameObject; _otherTemplate = FindChildByName(_panelRoot, otherTemplateName)?.gameObject; - + if (_selfTemplate == null || _otherTemplate == null) { Debug.LogWarning($"[GoldColumn] 未在面板下找到模板 {selfTemplateName}({_selfTemplate != null}) / " + @@ -261,19 +261,22 @@ public class GoldColumnController : MonoBehaviour $"barW={_barWidth} text={item.numText != null} tmp={item.numTmp != null}"); // 生长(动画 sizeDelta.y,不能动 fillAmount:柱头/数字锚在父顶边,靠父变高上移) - item.rt.DOKill(); + // ⭐ 尺寸/位移用各自独立的 tween:补位平移时只打断位移,绝不动尺寸,否则柱高会卡在半途 + item.sizeTween?.Kill(); + item.moveTween?.Kill(); item.alphaTween?.Kill(); + item.moveTween = null; item.rt.sizeDelta = new Vector2(_barWidth, 0f); item.alpha = 0f; ApplyAlpha(item, 0f); - item.rtTween = item.rt.DOSizeDelta(new Vector2(_barWidth, aimHeight), growDuration).SetEase(Ease.OutCubic); + item.sizeTween = item.rt.DOSizeDelta(new Vector2(_barWidth, aimHeight), growDuration).SetEase(Ease.OutCubic); item.alphaTween = DOTween.To(() => item.alpha, a => { item.alpha = a; ApplyAlpha(item, a); }, 1f, growDuration) .SetEase(Ease.OutQuad); list.Add(item); // 单根独占时走 holdDuration(PW:EnterAction 里 index==1 → 2 秒) - if (list.Count == 1) + if (item.index == 0) item.holdRemaining = holdDuration; } @@ -284,23 +287,42 @@ public class GoldColumnController : MonoBehaviour if (list.Count == 0) return; var head = list[0]; - head.fading = true; - list.RemoveAt(0); + if (head.fading) return; // 已在淡出中 - head.rtTween?.Kill(); + // ⭐ 队头淡出期间仍留在列表里占 0 号位:这 0.3s 内新柱的序号从 1 起, + // 不会生成到 0 号位跟正在淡出的柱重叠;等淡完(复刻 PW onEnd)再从列表移除 + 回收 + 补位 + head.fading = true; + head.sizeTween?.Kill(); + head.moveTween?.Kill(); head.alphaTween?.Kill(); head.alphaTween = DOTween.To(() => head.alpha, a => { head.alpha = a; ApplyAlpha(head, a); }, 0f, fadeDuration) .SetEase(Ease.InQuad) - .OnComplete(() => RecycleItem(head)); + .OnComplete(() => + { + var l = _list != null && pos < _list.Length ? _list[pos] : null; + if (l != null) + { + if (l.Count > 0 && l[0] == head) l.RemoveAt(0); + else l.Remove(head); + } + RecycleItem(head); + ShiftAfterHead(pos); + }); + } + + /// 队头淡出完成后:剩余柱按新序号补位(用 basePos 绝对定位,避免多次补位误差累积)。 + private void ShiftAfterHead(int pos) + { + var list = _list[pos]; + if (list == null) return; - // 补位:所有剩余柱 index-1,向座位方向移动 deltaX for (int i = 0; i < list.Count; i++) { var item = list[i]; item.index = i; - float targetX = item.rt.anchoredPosition.x - item.sign * deltaX; - item.rtTween?.Kill(); - item.rtTween = item.rt.DOAnchorPosX(targetX, shiftDuration).SetEase(Ease.Linear); + float targetX = item.basePos.x + item.sign * (offsetX + i * deltaX); + item.moveTween?.Kill(); + item.moveTween = item.rt.DOAnchorPosX(targetX, shiftDuration).SetEase(Ease.Linear); } // 新队头停顿(PW:队伍数量 > 3 → 0,否则 crowdDelay) @@ -379,8 +401,10 @@ public class GoldColumnController : MonoBehaviour { if (item == null) return; - item.rt?.DOKill(); + item.sizeTween?.Kill(); + item.moveTween?.Kill(); item.alphaTween?.Kill(); + item.moveTween = null; var pool = item.isSelf ? _poolSelf : _poolOther; if (pool.Count < preloadNum) @@ -399,7 +423,8 @@ public class GoldColumnController : MonoBehaviour private void DestroyItem(GoldColumnItem item) { if (item == null) return; - item.rt?.DOKill(); + item.sizeTween?.Kill(); + item.moveTween?.Kill(); item.alphaTween?.Kill(); if (item.go != null) Destroy(item.go); } @@ -495,7 +520,8 @@ public class GoldColumnController : MonoBehaviour public bool fading; public float alpha; - public Tween rtTween; - public Tween alphaTween; + public Tween sizeTween; // 生长/尺寸 + public Tween moveTween; // 补位平移 + public Tween alphaTween; // 淡入/淡出 } }