多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -0,0 +1,50 @@
using System.Collections;
using UnityEngine;
using BaseGames.Core;
using BaseGames.Core.Pool;
namespace BaseGames.Enemies.Boss.Patterns
{
/// <summary>
/// 攻击预警系统(架构 07_EnemyModule §11
/// 在攻击前若干帧显示视觉提示VFX 从对象池取出,到期归还)。
/// 由 BD_TelegraphAttack 通过协程调用 ShowTelegraph。
/// </summary>
public class TelegraphSystem : MonoBehaviour
{
/// <summary>
/// 开始预警:从对象池取出 vfxKey 对应预警 VFX等待 duration 秒后归还。
/// 由 BD_TelegraphAttack.OnStart 通过 StartCoroutine 调用。
/// </summary>
public IEnumerator ShowTelegraph(string vfxKey, float duration, Vector2 position)
{
if (string.IsNullOrEmpty(vfxKey) || duration <= 0f)
{
yield return null;
yield break;
}
GameObject vfx = null;
var pool = ServiceLocator.GetOrDefault<IObjectPoolService>();
if (pool != null)
vfx = pool.Spawn(vfxKey, new Vector3(position.x, position.y, 0f), Quaternion.identity);
else
Debug.LogWarning($"[TelegraphSystem] IObjectPoolService 未就绪,预警 VFX '{vfxKey}' 无法显示。");
yield return new WaitForSeconds(duration);
if (vfx != null && pool != null)
{
var po = vfx.GetComponent<PooledObject>();
if (po != null) po.ReturnToPool();
else vfx.SetActive(false);
}
}
/// <summary>立即隐藏所有活跃预警 VFX技能被打断时调用。</summary>
public void CancelTelegraph()
{
StopAllCoroutines();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e6f4987894dfe1648909b6863c003c31
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: