This commit is contained in:
2026-07-27 16:59:22 +08:00
parent 48863cc4f8
commit 738b2b2d36
11 changed files with 298 additions and 89 deletions
@@ -754,6 +754,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
await FishResourcesData.UnLoadFishAssetsData();
await AudioResourcesData.UnLoadAudioGame();
await MonsterMoveLine.UnLoadBezier();
// ⭐ 清空子弹池 + 特效池(鱼池已在 UnLoadFishAssetsData 内清理)
BulletPool.Instance.ClearAll();
EffectPool.Instance.ClearAll();
_resourcesUnloaded = true;
}
@@ -789,6 +792,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
CreateFishManager.Instance.ExitRoom();
CreateFishManager.Instance.isResources = false;
// ⭐ 清空子弹池 + 特效池(鱼池已在 UnLoadFishAssetsData 内清理)
BulletPool.Instance.ClearAll();
EffectPool.Instance.ClearAll();
JinDuTiao.SetProgress(0.9f);
// ⭐ 最后2秒留着(和加入游戏流程一致)
@@ -1599,6 +1605,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
return;
}
pos = fallback.position;
// ⭐ 修复:fallback 有效时也要激活图标(之前漏掉导致子锁定图标偶尔不显示)
if (!icon.activeSelf) icon.SetActive(true);
}
else
{
@@ -1657,6 +1665,16 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
Transform lockTr = ResolveLockTransform(target, out colliderIndex);
currSitData.SetLockTarget(target, lockTr);
SyncLock(new List<string> { target?.guid }, colliderIndex);
// ⭐ 切换目标的瞬间立即更新主锁定图标位置和显示,
// 避免切换那帧图标还停在旧位置或没显示出来
if (currSitData.lockFX != null && lockTr != null && lockTr.gameObject.activeInHierarchy)
{
if (!currSitData.lockFX.activeSelf) currSitData.lockFX.SetActive(true);
Vector3 p = lockTr.position;
p.z = Camera.main.transform.position.z + 1;
currSitData.lockFX.transform.position = p;
}
}
else
{
@@ -2434,7 +2452,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
entryGold = entryGold,
entryTime = Time.time,
currentLevelIndex = initIdx,
nextMultiplierCheckTime = Time.time + 2f,
// ⭐ 初始检查时间加随机偏移(0~3s),避免多个 bot 同时换炮倍
nextMultiplierCheckTime = Time.time + 2f + Random.Range(0f, 3f),
nextExitCheckTime = Time.time + 5f,
hasExited = false
};
@@ -2600,7 +2619,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
if (cfg == null || cfg.multiplier == null) return;
var mc = cfg.multiplier;
if (Time.time < state.nextMultiplierCheckTime) return;
state.nextMultiplierCheckTime = Time.time + mc.checkInterval;
// ⭐ 检查间隔加随机抖动(0.5~1.5 倍),避免多个 bot 同时换炮倍
state.nextMultiplierCheckTime = Time.time + mc.checkInterval * Random.Range(0.5f, 1.5f);
float ratio = state.GetGoldRatio(sit.goldNum);
int maxIdx = mc.maxLevelIndex < 0 ? GetPaoBeiCount() - 1 : mc.maxLevelIndex;