21
This commit is contained in:
@@ -1503,6 +1503,22 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
WebSocketSendList.SyncGameData(sgd);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清除所有座位对此鱼的锁定引用(鱼死亡/离场时调用,避免炮台继续对着死鱼/已回收鱼空转)。
|
||||
/// </summary>
|
||||
private void ClearLockOnFish(string fishId)
|
||||
{
|
||||
if (currGameType == null || currGameType.list_Sits == null) return;
|
||||
foreach (var sit in currGameType.list_Sits)
|
||||
{
|
||||
if (sit.monCotl_Lock != null && sit.monCotl_Lock.guid == fishId)
|
||||
{
|
||||
sit.monCotl_Lock = null;
|
||||
sit.monCotl_Lock_Position = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 鱼离场
|
||||
/// </summary>
|
||||
@@ -1530,6 +1546,10 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
// ⭐ 标记死亡:离场回收的鱼同样不可被命中/锁定(回池 OnEnable 会重置)
|
||||
monster.isDead = true;
|
||||
// ⭐ 清除座位锁定引用:炮台不再对着已离场的鱼
|
||||
ClearLockOnFish(fishId);
|
||||
Pool.Instance.Return(monster.gameObject);
|
||||
switch (monster.fishenum)
|
||||
{
|
||||
@@ -1591,6 +1611,11 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
$"fishNumber={monster.monsterData?.fishTypeConfig?.fishNumber} isyz={monster.isyz} yzID={monster.yzID} dictCount={fishDatas_hashCodekey.Count}",
|
||||
monster.GetInstanceID());
|
||||
|
||||
// ⭐ 统一标记死亡:死亡后子弹不再命中、不再被锁定
|
||||
monster.isDead = true;
|
||||
// ⭐ 清除座位锁定引用:炮台不再对着死亡的鱼
|
||||
ClearLockOnFish(fishId);
|
||||
|
||||
// 👁 调试:记录每架掉金币飞机的实际坐标,便于对比"其他位置掉金币"来源
|
||||
Debug.Log($"[掉金币坐标] fishId={fishId} 飞机坐标={monster.transform.position} 金币飞向={v3Point} isLocal={isLocal} 调用栈={System.Environment.StackTrace}");
|
||||
|
||||
@@ -1721,17 +1746,18 @@ public class CreateFishManager : MonoSingleton<CreateFishManager>
|
||||
{
|
||||
if (item.user == killFish.userId)
|
||||
{
|
||||
// 只有死的鱼正好是当前锁定目标时才清除
|
||||
if (item.monCotl_Lock != null && item.monCotl_Lock.guid == killFish.fishId)
|
||||
item.monCotl_Lock = null;
|
||||
//item.lockFX.gameObject.SetActive(false);
|
||||
sitData = item;
|
||||
}
|
||||
}
|
||||
// ⭐ 死鱼清除所有座位的锁定引用(原逻辑只清击杀者座位,其他座位锁同一条鱼时不清)
|
||||
ClearLockOnFish(killFish.fishId);
|
||||
|
||||
|
||||
if (!fishDatas_hashCodekey.TryGetValue(killFish.fishId, out var monster)) return;
|
||||
|
||||
// ⭐ 统一标记死亡:死亡后子弹不再命中、不再被锁定(含不调 base.DieFish 的 Boss 子类)
|
||||
monster.isDead = true;
|
||||
|
||||
// 死亡粒子特效(池化,粒子播完自动回池)
|
||||
EffectPool.Instance.Get(
|
||||
|
||||
Reference in New Issue
Block a user