cun
This commit is contained in:
@@ -445,6 +445,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
HandleAutoFire(); // 自动开火真正发射
|
||||
HandleLock();
|
||||
UpdateLockFX();
|
||||
RefreshTripleLockIcons();
|
||||
|
||||
HandleAutoLock();
|
||||
LoopLaser();
|
||||
@@ -1143,6 +1144,28 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
#endregion
|
||||
|
||||
#region 锁定系统(LockModule)
|
||||
/// <summary>
|
||||
/// 刷新三发锁定图标:三发+锁定开启时显示3个锁定圈
|
||||
/// </summary>
|
||||
private void RefreshTripleLockIcons()
|
||||
{
|
||||
if (currSitData == null) return;
|
||||
|
||||
bool isTripleLock = toggle_Three.isOn && toggle_Lock.isOn && currSitData.isLock;
|
||||
if (!isTripleLock)
|
||||
{
|
||||
currSitData.HideTripleLockIcons();
|
||||
return;
|
||||
}
|
||||
|
||||
// 已经有三发目标 → 跳过
|
||||
if (currSitData.tripleLockTargets.Count > 0) return;
|
||||
|
||||
var targets = FindFireTargets(3);
|
||||
if (targets.Count > 0)
|
||||
currSitData.SetTripleLockTargets(targets);
|
||||
}
|
||||
|
||||
//private void HandleLock()
|
||||
//{
|
||||
// CrossPlatformInput input = GetInput();
|
||||
@@ -1238,48 +1261,65 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
foreach (var sit in list_Sits)
|
||||
{
|
||||
if (!sit.isLock || sit.monCotl_Lock == null) continue;
|
||||
Vector3 pos = Vector3.zero;
|
||||
|
||||
if (!sit.monCotl_Lock_Position.gameObject.activeInHierarchy)
|
||||
// 更新主锁定图标
|
||||
UpdateSingleLockFX(sit, sit.monCotl_Lock, sit.monCotl_Lock_Position, sit.lockFX);
|
||||
|
||||
// 更新三发锁定额外图标
|
||||
for (int i = 0; i < sit.lockFX_Triple.Count && i < sit.tripleLockTargets.Count; i++)
|
||||
{
|
||||
if (sit.monCotl_Lock.colliderList != null && sit.monCotl_Lock.colliderList.Count > 0)
|
||||
var icon = sit.lockFX_Triple[i];
|
||||
var monster = sit.tripleLockTargets[i];
|
||||
var hitPos = sit.tripleLockPositions[i];
|
||||
if (icon == null || monster == null || hitPos == null) continue;
|
||||
UpdateSingleLockFX(sit, monster, hitPos, icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSingleLockFX(SitPosData sit, MonsterContral monster, Transform hitPos, GameObject icon)
|
||||
{
|
||||
Vector3 pos = Vector3.zero;
|
||||
|
||||
if (!hitPos.gameObject.activeInHierarchy)
|
||||
{
|
||||
if (monster.colliderList != null && monster.colliderList.Count > 0)
|
||||
{
|
||||
bool found = false;
|
||||
foreach (Transform t in monster.colliderList)
|
||||
{
|
||||
foreach (Transform t in sit.monCotl_Lock.colliderList)
|
||||
if (t.gameObject.activeInHierarchy)
|
||||
{
|
||||
if (t.gameObject.activeInHierarchy)
|
||||
{
|
||||
sit.monCotl_Lock_Position = t;
|
||||
pos = sit.monCotl_Lock_Position.position;
|
||||
break;
|
||||
}
|
||||
pos = t.position;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!found)
|
||||
{
|
||||
// 无 colliderList: 用 lockPoint 兜底
|
||||
sit.monCotl_Lock_Position = sit.monCotl_Lock.lockPoint ?? sit.monCotl_Lock.transform;
|
||||
pos = sit.monCotl_Lock_Position.position;
|
||||
}
|
||||
if (!sit.monCotl_Lock_Position.gameObject.activeInHierarchy)
|
||||
{
|
||||
if (sit.lockFX.activeSelf)
|
||||
|
||||
sit.lockFX.SetActive(false);
|
||||
if (icon.activeSelf) icon.SetActive(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = sit.monCotl_Lock_Position.position;
|
||||
if (!sit.lockFX.activeSelf)
|
||||
sit.lockFX.SetActive(true);
|
||||
var lp = monster.lockPoint ?? monster.transform;
|
||||
pos = lp.position;
|
||||
}
|
||||
if (!hitPos.gameObject.activeInHierarchy)
|
||||
{
|
||||
if (icon.activeSelf) icon.SetActive(false);
|
||||
return;
|
||||
}
|
||||
|
||||
pos.z = Camera.main.transform.position.z + 1;
|
||||
|
||||
sit.lockFX.transform.position = pos;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = hitPos.position;
|
||||
if (!icon.activeSelf) icon.SetActive(true);
|
||||
}
|
||||
|
||||
pos.z = Camera.main.transform.position.z + 1;
|
||||
icon.transform.position = pos;
|
||||
}
|
||||
private void CheckLockTargetValid()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user