1
This commit is contained in:
@@ -1408,7 +1408,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
}
|
||||
}
|
||||
|
||||
if (targetMonster != null)
|
||||
if (targetMonster != null && targetHitPos != null)
|
||||
{
|
||||
// 朝目标发射
|
||||
Vector3 targetWorldPos = targetHitPos.position;
|
||||
@@ -1596,15 +1596,18 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ⭐ 判断鱼是否有激活的锁定锚点(lockPoint 或 colliderList 中任一碰撞器)。
|
||||
/// 鱼出场效果期间 lockPoint 和 collider 都未激活 → 不可锁定,应换一条鱼。
|
||||
/// ⭐ 判断鱼是否可锁定。
|
||||
/// - needLockEvent=false 的鱼:一直可锁定(只要 activeInHierarchy)
|
||||
/// - needLockEvent=true 的鱼:出场/状态切换期间 isLockable=false,等 NotifyLockable() 后才可锁定
|
||||
/// 同时要求有激活的锁定锚点(lockPoint 或 colliderList 任一激活)
|
||||
/// </summary>
|
||||
private bool HasActiveLockPoint(MonsterContral monster)
|
||||
private bool IsMonsterLockable(MonsterContral monster)
|
||||
{
|
||||
if (monster == null) return false;
|
||||
// lockPoint 激活
|
||||
if (monster == null || !monster.gameObject.activeInHierarchy) return false;
|
||||
// ⭐ 可锁定事件控制:needLockEvent=true 的鱼未触发 NotifyLockable 前不可锁定
|
||||
if (!monster.isLockable) return false;
|
||||
// ⭐ 锚点激活检查:lockPoint 或 colliderList 任一激活
|
||||
if (monster.lockPoint != null && monster.lockPoint.gameObject.activeInHierarchy) return true;
|
||||
// colliderList 任一激活
|
||||
if (monster.colliderList != null)
|
||||
{
|
||||
for (int i = 0; i < monster.colliderList.Count; i++)
|
||||
@@ -1717,8 +1720,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (selected.Contains(m.guid)) continue; // 跳过已选中的
|
||||
// ⭐ 路径进度过滤:刚出生(< 0.2)或即将离场(> 0.8)的鱼不作为目标
|
||||
if (!IsFishPathLockable(m)) continue;
|
||||
// ⭐ 锚点过滤:出场效果期间 lockPoint 和 collider 都未激活 → 跳过换下一条
|
||||
if (!HasActiveLockPoint(m)) continue;
|
||||
// ⭐ 可锁定过滤:出场效果期间/needLockEvent 鱼未就绪 → 跳过换下一条
|
||||
if (!IsMonsterLockable(m)) continue;
|
||||
|
||||
// ⭐ 统一用 ResolveLockTransform:lockPoint → colliderList → (null则不选)
|
||||
Transform pos = ResolveLockTransform(m);
|
||||
@@ -1830,6 +1833,15 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
if (!sit.isLock || sit.monCotl_Lock == null) continue;
|
||||
|
||||
// ⭐ 切换锁定点(小白龙等切换模型后锁定点失效):
|
||||
// 当前 monCotl_Lock_Position 失效 → 调 SwitchLockPoint 重新取激活的锚点
|
||||
if (sit.monCotl_Lock_Position == null || !sit.monCotl_Lock_Position.gameObject.activeInHierarchy)
|
||||
{
|
||||
Transform newLockPos = sit.monCotl_Lock.SwitchLockPoint();
|
||||
if (newLockPos != null)
|
||||
sit.monCotl_Lock_Position = newLockPos;
|
||||
}
|
||||
|
||||
// 更新主锁定图标
|
||||
UpdateSingleLockFX(sit, sit.monCotl_Lock, sit.monCotl_Lock_Position, sit.lockFX);
|
||||
|
||||
@@ -1844,6 +1856,16 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
var monster = sit.tripleLockTargets[targetIdx];
|
||||
var hitPos = sit.tripleLockPositions[targetIdx];
|
||||
if (icon == null || monster == null) continue;
|
||||
// ⭐ 同样为三发目标切换锁定点
|
||||
if (hitPos == null || !hitPos.gameObject.activeInHierarchy)
|
||||
{
|
||||
Transform newLockPos = monster.SwitchLockPoint();
|
||||
if (newLockPos != null)
|
||||
{
|
||||
sit.tripleLockPositions[targetIdx] = newLockPos;
|
||||
hitPos = newLockPos;
|
||||
}
|
||||
}
|
||||
UpdateSingleLockFX(sit, monster, hitPos, icon);
|
||||
}
|
||||
}
|
||||
@@ -2000,8 +2022,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (m == null || !m.gameObject.activeInHierarchy) continue;
|
||||
// ⭐ 路径进度过滤:刚出生(< 0.2)或即将离场(> 0.8)的鱼不作为自动锁定目标
|
||||
if (!IsFishPathLockable(m)) continue;
|
||||
// ⭐ 锚点过滤:出场效果期间 lockPoint 和 collider 都未激活 → 跳过换下一条
|
||||
if (!HasActiveLockPoint(m)) continue;
|
||||
// ⭐ 可锁定过滤:出场效果期间/needLockEvent 鱼未就绪 → 跳过换下一条
|
||||
if (!IsMonsterLockable(m)) continue;
|
||||
|
||||
int pri = GetFishLockPriority(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user