From bc69c6c8370d3af495e602f0c0fc01013c247c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A3=AE2003?= <2384017988@qq.com> Date: Fri, 24 Jul 2026 23:47:50 +0800 Subject: [PATCH] 1 --- Assets/Art/FengLei/ResLY/Material/tex_171.mat | 13 ++ .../Art/FengLei/ResLY/Material/tex_171_1.mat | 13 ++ .../Characters/Monster/MonsterContral.cs | 17 +- .../Scripts/Manager/CreateFishManager.cs | 20 ++- .../Scripts/Net/WebSocketReponseList.cs | 8 +- .../MyGame/aa/Game/FLZY/BOSS/JBP/176.prefab | 25 ++- .../aa/Game/FLZY/BOSS/JL/fish_136.prefab | 8 +- .../aa/Game/FLZY/BOSS/QL/fish_144.prefab | 8 +- .../MyGame/aa/Game/FLZY/BOSS/YGLG/6005.prefab | 28 +++- .../aa/UI/Game/FLZY/GameMainPanel_FLZY.prefab | 66 ++++++-- .../aa/UI/Game/GameMainPanel_FishBase.cs | 158 +++++++++++------- .../aa/UI/Game/HHWK/GameMainPanel_HHWK.prefab | 64 +++++-- 12 files changed, 320 insertions(+), 108 deletions(-) diff --git a/Assets/Art/FengLei/ResLY/Material/tex_171.mat b/Assets/Art/FengLei/ResLY/Material/tex_171.mat index 9469f721b..7f3ddf1a5 100644 --- a/Assets/Art/FengLei/ResLY/Material/tex_171.mat +++ b/Assets/Art/FengLei/ResLY/Material/tex_171.mat @@ -86,3 +86,16 @@ Material: - _SpecCor: {r: 1, g: 1, b: 1, a: 0.45490196} - _WaveColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] +--- !u!114 &1034597170340571397 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/Assets/Art/FengLei/ResLY/Material/tex_171_1.mat b/Assets/Art/FengLei/ResLY/Material/tex_171_1.mat index ae2aa1458..044df1cd4 100644 --- a/Assets/Art/FengLei/ResLY/Material/tex_171_1.mat +++ b/Assets/Art/FengLei/ResLY/Material/tex_171_1.mat @@ -86,3 +86,16 @@ Material: - _SpecCor: {r: 1, g: 1, b: 1, a: 1} - _WaveColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] +--- !u!114 &1391895582203003865 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 diff --git a/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs b/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs index 3cc0fe13f..a27db58fc 100644 --- a/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs +++ b/Assets/MyGame/Scripts/Characters/Monster/MonsterContral.cs @@ -158,13 +158,28 @@ public class MonsterContral : MonoBehaviour } public virtual void OnEnable() { - //isMove = true; + // ⭐ 重置 isMove=true:池回收的鱼重新生成时,必须恢复移动状态。 + // 之前被注释掉导致:冰冻时 FreezeAllFish 设 isMove=false → 鱼被回收 → + // 重新生成后 isMove 残留 false → 鱼永远不动(一直在中间不会游动)。 + // 冰冻中重新激活的鱼,FreezeAllFish 会立即覆盖为 false,安全。 + isMove = true; fishenum = (FishTypeEnum)monsterData.fishTypeConfig.fishType; uirootRect = UIManager.Instance.uiRoot.GetComponent(); mainCamera = Camera.main; moveTime = 0f; InitAnimList(); ChangeState(CharacterStateType.move); + + // ⭐ 同步冰冻特效状态:池回收的鱼 bingDongEffect 可能残留激活状态, + // 重新生成时会显示白色冰冻蒙皮。根据当前是否冰冻中决定显隐 + bool frozen = CreateFishManager.Instance != null && CreateFishManager.Instance.isFrozen; + SetFreezeEffect(frozen); + if (frozen) + { + // 冰冻中重新生成的鱼也要被冻结 + isMove = false; + ChangeState(CharacterStateType.idle); + } } private void Update() diff --git a/Assets/MyGame/Scripts/Manager/CreateFishManager.cs b/Assets/MyGame/Scripts/Manager/CreateFishManager.cs index 92a8b6a75..243027869 100644 --- a/Assets/MyGame/Scripts/Manager/CreateFishManager.cs +++ b/Assets/MyGame/Scripts/Manager/CreateFishManager.cs @@ -654,10 +654,10 @@ public class CreateFishManager : MonoSingleton return; foreach (var item in bossList) { - if (item.fishNumber == "11030") + if (item.fishNumber == "11026") item.isCreate = 2; - if (item.fishNumber == "11027") + if (item.fishNumber == "11035") item.isCreate = 2; // if (item.fishNumber == "11030") // item.isCreate = 2; @@ -2096,7 +2096,10 @@ public class CreateFishManager : MonoSingleton public void FreezeAllFish() { isFrozen = true; + // ⭐ 两个字典必须同步清空,否则 frozenFishIsMoves 残留旧数据 + // 会导致下次解冻时用旧值覆盖 isMove 但不恢复 currState frozenFishStates.Clear(); + frozenFishIsMoves.Clear(); // 只遍历全量字典 fishDatas_hashCodekey(已包含所有鱼),不重复遍历子字典 if (fishDatas_hashCodekey != null) @@ -2131,16 +2134,25 @@ public class CreateFishManager : MonoSingleton MonsterContral m = kv.Value; if (m == null || !m.gameObject.activeInHierarchy) continue; + // ⭐ 只恢复本次冰冻记录的鱼(frozenFishStates 有记录才恢复) + // 避免用 frozenFishIsMoves 的旧数据覆盖未冻结鱼的 isMove + if (!frozenFishStates.TryGetValue(m.guid, out var prevState)) + continue; + + // 恢复冰冻前的 isMove 和 currState if (frozenFishIsMoves.TryGetValue(m.guid, out var prevIsMove)) m.isMove = prevIsMove; + else + m.isMove = true; // 兜底:没记录就恢复为可移动 m.SetFreezeEffect(false); - if (frozenFishStates.TryGetValue(m.guid, out var prevState)) - m.ChangeState(prevState); + m.ChangeState(prevState); } } + // ⭐ 两个字典同步清空 frozenFishStates.Clear(); + frozenFishIsMoves.Clear(); } #endregion } diff --git a/Assets/MyGame/Scripts/Net/WebSocketReponseList.cs b/Assets/MyGame/Scripts/Net/WebSocketReponseList.cs index 5f167bb6f..71cc1a146 100644 --- a/Assets/MyGame/Scripts/Net/WebSocketReponseList.cs +++ b/Assets/MyGame/Scripts/Net/WebSocketReponseList.cs @@ -566,7 +566,13 @@ namespace Assets.MyGame.Scripts.Net // 只处理当前登录用户被顶的情况 if (data != null && !string.IsNullOrEmpty(data.userId) && !string.IsNullOrEmpty(userId) && data.userId != userId) - return; + { + UIManager.Instance.ShowTiShi("账号已在其他地方登录", () => + { + GameManager.Instance.Logout(); + return; + }); + } } catch (Exception e) { diff --git a/Assets/MyGame/aa/Game/FLZY/BOSS/JBP/176.prefab b/Assets/MyGame/aa/Game/FLZY/BOSS/JBP/176.prefab index 9763aa426..40f880d50 100644 --- a/Assets/MyGame/aa/Game/FLZY/BOSS/JBP/176.prefab +++ b/Assets/MyGame/aa/Game/FLZY/BOSS/JBP/176.prefab @@ -310,7 +310,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1697762167430256, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 1697762167430256, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_TagString @@ -958,15 +958,15 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4707758849810793, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_LocalScale.x - value: 30 + value: 25 objectReference: {fileID: 0} - target: {fileID: 4707758849810793, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_LocalScale.y - value: 30 + value: 25 objectReference: {fileID: 0} - target: {fileID: 4707758849810793, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_LocalScale.z - value: 30 + value: 25 objectReference: {fileID: 0} - target: {fileID: 4707758849810793, guid: 53fb934139b912d4eb7fc7e42ae84334, type: 3} propertyPath: m_LocalPosition.x @@ -1767,16 +1767,28 @@ MonoBehaviour: m_EditorClassIdentifier: beilv: 0 guid: + lastMoveLineId: monsterData: die_Score: 0 isDie: 0 fishTypeConfig: fishNumber: fishName: + fishBrief: fishType: 0 fishScore: 0 killWeight: 0 pathList: + fishImage: + fishMultipleDesc: + moveLine: + bezierCurveData: + name: + start: {x: 0, y: 0} + controlPoints: [] + end: {x: 0, y: 0} + moveTime: 0 + moveSpeed: 0 skeleton: {fileID: 0} isSpine: 1 fishTypeID: 11026 @@ -1795,8 +1807,10 @@ MonoBehaviour: yzID: colliderList: [] lockPoint: {fileID: 3118873771312464526} + bingDongEffect: {fileID: 0} rotationPY: 60 isRotate: 0 + isNot1: 0 ischild0: 1 depthOffset: 250 bossName: "\u805A\u5B9D\u76C6" @@ -1810,6 +1824,8 @@ MonoBehaviour: isDieFish: 0 dieTime: 3 v3: {x: 0, y: 0, z: 0} + isLocalCoin: 0 + killerSitPos: -1 idleAnim: {fileID: 3084212258959664462} effect1: {fileID: 7917591688779815920} effect2: {fileID: 8659896028027952469} @@ -1852,6 +1868,7 @@ MonoBehaviour: coinFlyDuration: 0.5 coinArrivalInterval: 0.1 isSelf: 0 + autoFinishOnScoreFull: 1 totalBJCount: 0 currBJCount: 0 isEffEnd: 0 diff --git a/Assets/MyGame/aa/Game/FLZY/BOSS/JL/fish_136.prefab b/Assets/MyGame/aa/Game/FLZY/BOSS/JL/fish_136.prefab index bc3bdcd01..0d5a7131b 100644 --- a/Assets/MyGame/aa/Game/FLZY/BOSS/JL/fish_136.prefab +++ b/Assets/MyGame/aa/Game/FLZY/BOSS/JL/fish_136.prefab @@ -930,7 +930,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1361653457580592, guid: 055ba0a273a3d0c48a43f4fb3f92dc4d, type: 3} propertyPath: m_IsActive - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 1361653457580592, guid: 055ba0a273a3d0c48a43f4fb3f92dc4d, type: 3} propertyPath: m_TagString @@ -7283,9 +7283,9 @@ Animator: type: 3} m_PrefabInstance: {fileID: 7185978563645214470} m_PrefabAsset: {fileID: 0} ---- !u!4 &7185125104697894038 stripped +--- !u!4 &7181217104733412390 stripped Transform: - m_CorrespondingSourceObject: {fileID: 4231301349993360, guid: 055ba0a273a3d0c48a43f4fb3f92dc4d, + m_CorrespondingSourceObject: {fileID: 4916496161379104, guid: 055ba0a273a3d0c48a43f4fb3f92dc4d, type: 3} m_PrefabInstance: {fileID: 7185978563645214470} m_PrefabAsset: {fileID: 0} @@ -7348,7 +7348,7 @@ MonoBehaviour: isyz: 0 yzID: colliderList: [] - lockPoint: {fileID: 7185125104697894038} + lockPoint: {fileID: 7181217104733412390} bingDongEffect: {fileID: 0} rotationPY: 60 isRotate: 0 diff --git a/Assets/MyGame/aa/Game/FLZY/BOSS/QL/fish_144.prefab b/Assets/MyGame/aa/Game/FLZY/BOSS/QL/fish_144.prefab index 375445459..55a24dac1 100644 --- a/Assets/MyGame/aa/Game/FLZY/BOSS/QL/fish_144.prefab +++ b/Assets/MyGame/aa/Game/FLZY/BOSS/QL/fish_144.prefab @@ -7425,12 +7425,6 @@ Transform: type: 3} m_PrefabInstance: {fileID: 98071442387624804} m_PrefabAsset: {fileID: 0} ---- !u!4 &93793445555571887 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 4877232833458123, guid: d82e692e41cc85e4e86f6899f58f771d, - type: 3} - m_PrefabInstance: {fileID: 98071442387624804} - m_PrefabAsset: {fileID: 0} --- !u!4 &93946421411710175 stripped Transform: m_CorrespondingSourceObject: {fileID: 4970551864321979, guid: d82e692e41cc85e4e86f6899f58f771d, @@ -7543,7 +7537,7 @@ MonoBehaviour: - {fileID: 93594333527686029} - {fileID: 93477760682605764} - {fileID: 95139269106097999} - lockPoint: {fileID: 93793445555571887} + lockPoint: {fileID: 95425877480302237} bingDongEffect: {fileID: 0} rotationPY: 60 isRotate: 0 diff --git a/Assets/MyGame/aa/Game/FLZY/BOSS/YGLG/6005.prefab b/Assets/MyGame/aa/Game/FLZY/BOSS/YGLG/6005.prefab index d6a16fdf6..d9e251e41 100644 --- a/Assets/MyGame/aa/Game/FLZY/BOSS/YGLG/6005.prefab +++ b/Assets/MyGame/aa/Game/FLZY/BOSS/YGLG/6005.prefab @@ -444,7 +444,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1180172148385199, guid: 24f1136b5772c7a428221f9ea1e47092, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 1180172148385199, guid: 24f1136b5772c7a428221f9ea1e47092, type: 3} propertyPath: m_TagString @@ -468,7 +468,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4652413757758945, guid: 24f1136b5772c7a428221f9ea1e47092, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: -13 objectReference: {fileID: 0} - target: {fileID: 4652413757758945, guid: 24f1136b5772c7a428221f9ea1e47092, type: 3} propertyPath: m_LocalPosition.z @@ -551,16 +551,28 @@ MonoBehaviour: m_EditorClassIdentifier: beilv: 0 guid: + lastMoveLineId: monsterData: die_Score: 0 isDie: 0 fishTypeConfig: fishNumber: fishName: + fishBrief: fishType: 0 fishScore: 0 killWeight: 0 pathList: + fishImage: + fishMultipleDesc: + moveLine: + bezierCurveData: + name: + start: {x: 0, y: 0} + controlPoints: [] + end: {x: 0, y: 0} + moveTime: 0 + moveSpeed: 0 skeleton: {fileID: 0} isSpine: 1 fishTypeID: 11035 @@ -596,6 +608,8 @@ MonoBehaviour: isDieFish: 0 dieTime: 3 v3: {x: 0, y: 0, z: 0} + isLocalCoin: 0 + killerSitPos: -1 playable: {fileID: 0} --- !u!1001 &8126523871117287450 PrefabInstance: @@ -2646,6 +2660,16 @@ PrefabInstance: propertyPath: m_Enabled value: 0 objectReference: {fileID: 0} + - target: {fileID: 199226291264488589, guid: 24f1136b5772c7a428221f9ea1e47092, + type: 3} + propertyPath: m_Materials.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 199924562111650557, guid: 24f1136b5772c7a428221f9ea1e47092, + type: 3} + propertyPath: m_Materials.Array.size + value: 1 + objectReference: {fileID: 0} - target: {fileID: 320336462471690087, guid: 24f1136b5772c7a428221f9ea1e47092, type: 3} propertyPath: m_Enabled diff --git a/Assets/MyGame/aa/UI/Game/FLZY/GameMainPanel_FLZY.prefab b/Assets/MyGame/aa/UI/Game/FLZY/GameMainPanel_FLZY.prefab index 430e3cbe7..0f7de4fb6 100644 --- a/Assets/MyGame/aa/UI/Game/FLZY/GameMainPanel_FLZY.prefab +++ b/Assets/MyGame/aa/UI/Game/FLZY/GameMainPanel_FLZY.prefab @@ -149,8 +149,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4281532197 + m_fontColor: {r: 0.1462264, g: 1, b: 0.19559065, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -175,7 +175,7 @@ MonoBehaviour: m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 4 - m_VerticalAlignment: 256 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -1004,7 +1004,7 @@ RectTransform: m_GameObject: {fileID: 2256120632316597695} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - {fileID: 3066473336798849514} @@ -1366,8 +1366,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4281532197 + m_fontColor: {r: 0.1462264, g: 1, b: 0.19559065, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -3663,7 +3663,7 @@ RectTransform: m_GameObject: {fileID: 5910028015393800118} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - {fileID: 8441262843426643071} @@ -3822,6 +3822,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6423145012526947125} + - component: {fileID: 3341872679389971736} + - component: {fileID: 613810603270246481} m_Layer: 5 m_Name: SubPanelParent m_TagString: Untagged @@ -3848,6 +3850,46 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &3341872679389971736 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6399151385746884331} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 1 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 10 + m_TargetDisplay: 0 +--- !u!114 &613810603270246481 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6399151385746884331} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 --- !u!1 &6403645202956704703 GameObject: m_ObjectHideFlags: 0 @@ -6130,8 +6172,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4281532197 + m_fontColor: {r: 0.1462264, g: 1, b: 0.19559065, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -6156,7 +6198,7 @@ MonoBehaviour: m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 4 - m_VerticalAlignment: 256 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -6377,7 +6419,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} @@ -6387,7 +6429,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} diff --git a/Assets/MyGame/aa/UI/Game/GameMainPanel_FishBase.cs b/Assets/MyGame/aa/UI/Game/GameMainPanel_FishBase.cs index ce90c8b6f..1ab1130ba 100644 --- a/Assets/MyGame/aa/UI/Game/GameMainPanel_FishBase.cs +++ b/Assets/MyGame/aa/UI/Game/GameMainPanel_FishBase.cs @@ -150,7 +150,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base private GameObject _bingFengInstance; // 克隆出来的实例 float bingFengDuration = 5f; // 冰封状态持续时间 public float currBingFengTime = 0f; - private Dictionary _frozenAnimSpeeds = new Dictionary(); + private Dictionary _frozenAnimSpeeds = new Dictionary(); // ⭐ 暴走/冰封本地数量:因为暂无扣减 API,激活时本地 -1,避免被 OnUserDataChanged 覆盖回服务端旧值 private int _localBaoZouCount = -1; // -1 表示尚未初始化 @@ -538,6 +538,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base { if (!on) { + // ⭐ 取消锁定开关 → 重置自动锁定激活状态,下次需重新手动锁定激活 + _autoLockActivated = false; + // 本地清理锁定 if (currSitData != null) { @@ -559,7 +562,13 @@ public class GameMainPanel_FishBase : GameMainPanel_Base } toggle_BaoZou.onValueChanged.AddListener(on => { - if (!on) return; + if (!on) + { + // ⭐ 打开后只能等倒计时结束自动关闭,不允许玩家手动关闭 + // 直接 SetIsOnWithoutNotify(true) 避免递归触发 onValueChanged + toggle_BaoZou.SetIsOnWithoutNotify(true); + return; + } if (_localBaoZouCount <= 0) { toggle_BaoZou.SetIsOnWithoutNotify(false); @@ -581,7 +590,13 @@ public class GameMainPanel_FishBase : GameMainPanel_Base } }); toggle_BingFeng.onValueChanged.AddListener(on => { - if (!on) return; + if (!on) + { + // ⭐ 打开后只能等倒计时结束自动关闭,不允许玩家手动关闭 + // 直接 SetIsOnWithoutNotify(true) 避免递归触发 onValueChanged + toggle_BingFeng.SetIsOnWithoutNotify(true); + return; + } if (_localBingFengCount <= 0) { toggle_BingFeng.SetIsOnWithoutNotify(false); @@ -1067,9 +1082,14 @@ public class GameMainPanel_FishBase : GameMainPanel_Base if (currFrenzyTime <= 0) { - toggle_BaoZou.isOn = false; + // ⭐ 倒计时结束自动关闭:用 SetIsOnWithoutNotify 避免触发 onValueChanged + // (onValueChanged 里禁止手动关闭会强制设回 true) + // 并清理狂暴状态(攻速/动画/isFrenzy 标志) + toggle_BaoZou.SetIsOnWithoutNotify(false); currFrenzyTime = 0f; if (img_BaoZou != null) img_BaoZou.fillAmount = 1f; + CreateFishManager.Instance.currGameType.isFrenzy = false; + SetFrenzy(false); } } @@ -1429,45 +1449,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base currSitData.SetTripleLockTargets(targets); } - //private void HandleLock() - //{ - // CrossPlatformInput input = GetInput(); + /// 自动锁定是否已激活:玩家首次手动锁定一条鱼后激活,该鱼死亡后开始自动转换目标 + private bool _autoLockActivated = false; - // if (!toggle_Lock.isOn) return; - - // // 只有按下或抬起的那一帧触发锁定(保留你原来的逻辑) - // if (!input.wasReleasedThisFrame && !input.wasPressedThisFrame) return; - - // // UI 点击过滤 - // if (IsPointerOverUI(input.position)) - // return; - - // // 🔧 修正:屏幕坐标转世界坐标需要指定 Z 轴(2D 正交相机专用) - // Vector3 mousePos = input.position; - // mousePos.z = -Camera.main.transform.position.z; // 关键修正 - // Vector2 worldPos = Camera.main.ScreenToWorldPoint(mousePos); - - // // 🔧 优化:将 LayerMask 缓存为成员变量,避免每次调用 GetMask(非必要,但更好) - // // 你可以在 Start 中初始化:fishLayerMask = LayerMask.GetMask("Fish"); - // // 这里直接写原方式也可以,但建议如下: - // int fishLayer = LayerMask.GetMask("Fish"); - // RaycastHit2D hit = Physics2D.Raycast(worldPos, Vector2.zero, 1, fishLayer); - - // if (hit.collider != null) - // { - // MonsterContral monster = hit.collider.GetComponentInParent(); - // currSitData.SetLockTarget(monster, hit.collider.transform); - - // // 保留你原来的调用方式:new List { monster?.guid } - // SyncLock(new List { monster?.guid }, monster.colliderList.IndexOf(hit.collider.transform)); - // } - // else - // { - // currSitData.ClearLock(); - // SyncTurretState(TurretState.Idle); - // SyncLock(null); // 保留你原来的重载(可能是 SyncLock(object) 或 SyncLock(string)) - // } - //} private void HandleLock() { // ⭐ 退出倒计时期间屏蔽本地玩家手动锁定,其他玩家和机器人不受影响 @@ -1521,6 +1505,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base Transform lockTr = ResolveLockTransform(monster, out colliderIndex); currSitData.SetLockTarget(monster, lockTr); SyncLock(new List { monster?.guid }, colliderIndex); + + // ⭐ 手动锁定成功 → 激活自动锁定(该鱼死亡后自动转换目标) + _autoLockActivated = true; } private void UpdateLockFX() { @@ -1593,9 +1580,12 @@ public class GameMainPanel_FishBase : GameMainPanel_Base // ⭐ 退出倒计时期间屏蔽本地玩家自动锁定,其他玩家和机器人不受影响 if (_isLeavingCountdown) return; - // 自动锁定必须满足:自动开火 + 锁定开关开启 - if (!toggle_SkillAuto.isOn) return; - if (!toggle_Lock.isOn) return; // ✔ 自动锁定必须在锁定开关开启时才工作 + // 自动锁定必须在锁定开关开启时才工作 + if (!toggle_Lock.isOn) return; + + // ⭐ 前提条件:玩家必须先手动锁定一条鱼来激活自动锁定 + // 激活后,当锁定的鱼死亡,自动转换到下一个目标 + if (!_autoLockActivated) return; // 已经有锁定目标并且还活着,就不重复找 if (currSitData.isLock && @@ -1605,6 +1595,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base return; } + // 当前锁定目标已死亡/失效 → 自动找下一个目标 MonsterContral target = FindAutoLockTarget(); if (target != null) { @@ -1616,9 +1607,13 @@ public class GameMainPanel_FishBase : GameMainPanel_Base } else { - currSitData.ClearLock(); - SyncTurretState(TurretState.Idle); - SyncLock(null); + // 场上没有可锁定目标 → 清除锁定(仅在当前有锁时清除,避免每帧广播) + if (currSitData.isLock) + { + currSitData.ClearLock(); + SyncTurretState(TurretState.Idle); + SyncLock(null); + } } } @@ -1629,12 +1624,18 @@ public class GameMainPanel_FishBase : GameMainPanel_Base CreateFishManager.Instance.fishDatas_hashCodekey.Count == 0) return null; - MonsterContral best = null; - float bestSqr = float.MaxValue; - // ⭐ 用世界坐标(Z=0平面),和 bot AI 一致,否则距离计算会异常(出现 3.4E+38 之类) Vector3 origin = currSitData.turretWorldPos; + // ⭐ 规则:特殊Boss / Boss鱼 / 特殊鱼 为高价值组(按优先级 + 距离最近), + // 黄金鱼 / 普通鱼 为普通组(随机选一只) + // 高价值组有目标时只从高价值组选;高价值组无目标时从普通组随机 + MonsterContral best = null; + int bestPri = -1; + float bestSqr = float.MaxValue; + + var normalList = new List(); + foreach (var kv in CreateFishManager.Instance.fishDatas_hashCodekey) { MonsterContral m = kv.Value; @@ -1642,15 +1643,34 @@ public class GameMainPanel_FishBase : GameMainPanel_Base // ⭐ 路径进度过滤:刚出生(< 0.2)或即将离场(> 0.8)的鱼不作为自动锁定目标 if (!IsFishPathLockable(m)) continue; - float sqr = (m.transform.position - origin).sqrMagnitude; - if (sqr < bestSqr) + int pri = GetFishLockPriority(m); + + // 高价值组:特殊Boss(5) / Boss鱼(4) / 特殊鱼(3) → 优先级 + 距离最近 + if (pri >= 3) { - bestSqr = sqr; - best = m; + float sqr = (m.transform.position - origin).sqrMagnitude; + if (pri > bestPri || (pri == bestPri && sqr < bestSqr)) + { + bestPri = pri; + bestSqr = sqr; + best = m; + } + } + // 普通组:黄金鱼(2) / 普通鱼(1) → 先收集,后面随机 + else + { + normalList.Add(m); } } - return best; + // 高价值组有目标 → 直接返回最高价值(同价值最近)的目标 + if (best != null) return best; + + // 高价值组无目标 → 从普通组随机选一只 + if (normalList.Count > 0) + return normalList[Random.Range(0, normalList.Count)]; + + return null; } //private void HandleAutoLock() @@ -2116,8 +2136,14 @@ public class GameMainPanel_FishBase : GameMainPanel_Base foreach (var an in root.GetComponentsInChildren(true)) { if (!an.gameObject.activeInHierarchy || !an.isPlaying) continue; - foreach (AnimationState state in an) state.speed = 0f; - _frozenAnimSpeeds[an] = 1f; + // ⭐ 记录每个 AnimationState 的原 speed,解冻时恢复原值而非硬编码 1f + var stateSpeeds = new List(); + foreach (AnimationState state in an) + { + stateSpeeds.Add(state.speed); + state.speed = 0f; + } + _frozenAnimSpeeds[an] = stateSpeeds; } foreach (var pd in root.GetComponentsInChildren(true)) { @@ -2136,10 +2162,20 @@ public class GameMainPanel_FishBase : GameMainPanel_Base if (kv.Key == null) continue; switch (kv.Key) { - case Spine.Unity.SkeletonAnimation s: s.timeScale = kv.Value; break; - case Animator a: a.speed = kv.Value; break; + case Spine.Unity.SkeletonAnimation s: s.timeScale = (float)kv.Value; break; + case Animator a: a.speed = (float)kv.Value; break; case Animation an: - foreach (AnimationState state in an) state.speed = 1f; + // ⭐ 恢复每个 AnimationState 的原 speed + if (kv.Value is List stateSpeeds) + { + int i = 0; + foreach (AnimationState state in an) + { + if (i < stateSpeeds.Count) + state.speed = stateSpeeds[i]; + i++; + } + } break; case UnityEngine.Playables.PlayableDirector pd: pd.Resume(); break; } diff --git a/Assets/MyGame/aa/UI/Game/HHWK/GameMainPanel_HHWK.prefab b/Assets/MyGame/aa/UI/Game/HHWK/GameMainPanel_HHWK.prefab index beaba030f..843a0418e 100644 --- a/Assets/MyGame/aa/UI/Game/HHWK/GameMainPanel_HHWK.prefab +++ b/Assets/MyGame/aa/UI/Game/HHWK/GameMainPanel_HHWK.prefab @@ -2368,8 +2368,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4278255415 + m_fontColor: {r: 0.21535873, g: 1, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -2394,7 +2394,7 @@ MonoBehaviour: m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 4 - m_VerticalAlignment: 256 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -2733,7 +2733,7 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 1729723357291826897} m_Father: {fileID: 6442325590043047767} @@ -3379,8 +3379,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4278255415 + m_fontColor: {r: 0.21535873, g: 1, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -3405,7 +3405,7 @@ MonoBehaviour: m_fontSizeMax: 72 m_fontStyle: 0 m_HorizontalAlignment: 4 - m_VerticalAlignment: 256 + m_VerticalAlignment: 1024 m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 @@ -3564,14 +3564,12 @@ MonoBehaviour: toggle_BaoZou: {fileID: 6820470193323630788} tmp_BaoZouCount: {fileID: 284534771226263952} img_BaoZou: {fileID: 4519855428832475769} - frenzyDuration: 5 currFrenzyTime: 0 toggle_BingFeng: {fileID: 7126682788597616111} tmp_BingFengCount: {fileID: 4517298797299028184} img_BingFeng: {fileID: 734296607713292731} bingFengEffect: {fileID: 1709254077376921, guid: a2a34db230a06c64c8d7cfad89a22d10, type: 3} - bingFengDuration: 5 currBingFengTime: 0 btn_GuaGuaKa: {fileID: 7915604937799543775} tmp_GGKCount: {fileID: 7599905240918815376} @@ -3884,6 +3882,8 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6423145012526947125} + - component: {fileID: 7165923567967766691} + - component: {fileID: 8217361257888957425} m_Layer: 5 m_Name: SubPanelParent m_TagString: Untagged @@ -3910,6 +3910,46 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &7165923567967766691 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6399151385746884331} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 1 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 10 + m_TargetDisplay: 0 +--- !u!114 &8217361257888957425 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6399151385746884331} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 --- !u!1 &6478921468864931545 GameObject: m_ObjectHideFlags: 0 @@ -4410,7 +4450,7 @@ RectTransform: m_GameObject: {fileID: 6646657068787545170} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.8, y: 0.8, z: 0.8} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - {fileID: 3062198352733159756} @@ -5664,8 +5704,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4294967295 - m_fontColor: {r: 1, g: 1, b: 1, a: 1} + rgba: 4278255415 + m_fontColor: {r: 0.21535873, g: 1, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: