refactor(enemy): 删预警旧路径,预警统一走动画
telegraphVfxKey / telegraphDuration / TelegraphRoutine 删除。 预警的正确载体是 clip 本身——姿态在动画里,音效与特效在动画事件上 (PlaySFX / TriggerFeedback 已于阶段一补接)。旧路径会在动画之前 插一段无动画的静止等待,是同一件事的第二条平行路。 AbilityRunState.Telegraph 枚举值保留:BlinkStrikeAbility 现身闪光段 仍在自己协程里显式置位(计划原文假设它零消费者,实测不成立), 只删了基类的默认预警协程。顺带清掉该文件里遗留的行为树插件措辞。 18 个 ABL_ 资产经 AssetDatabase.ForceReserializeAssets 重写, 去掉已删字段的死键;顺带补齐了这些旧资产缺失的当前字段默认值 (designNote / category / weight / rangeRadius / rangeOffset / maxDashDuration), 无任何已有取值被改动。SOValidationRunner:0 错误 0 警告。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,8 +17,6 @@ MonoBehaviour:
|
||||
BossPhaseAbilityGate \u914D\u7F6E"
|
||||
attackSequence: []
|
||||
cooldown: 4
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -17,8 +17,6 @@ MonoBehaviour:
|
||||
BossPhaseAbilityGate \u914D\u7F6E"
|
||||
attackSequence: []
|
||||
cooldown: 2.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -16,8 +16,6 @@ MonoBehaviour:
|
||||
designNote: "\u5165\u573A\u6F14\u51FA\uFF0C\u4E0D\u8FDB\u9009\u62DB\u6C60"
|
||||
attackSequence: []
|
||||
cooldown: 0
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -17,8 +17,6 @@ MonoBehaviour:
|
||||
BossPhaseAbilityGate \u914D\u7F6E"
|
||||
attackSequence: []
|
||||
cooldown: 6
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -17,8 +17,6 @@ MonoBehaviour:
|
||||
BossPhaseAbilityGate \u914D\u7F6E"
|
||||
attackSequence: []
|
||||
cooldown: 3.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -17,8 +17,6 @@ MonoBehaviour:
|
||||
BossPhaseAbilityGate \u914D\u7F6E"
|
||||
attackSequence: []
|
||||
cooldown: 3
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E001_Chase
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e001_chase
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
startClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
@@ -53,6 +56,7 @@ MonoBehaviour:
|
||||
_Clip: {fileID: 7400000, guid: 9f0fea347ba7eb347b0f71b423832808, type: 2}
|
||||
_NormalizedStartTime: NaN
|
||||
dashSpeed: 9
|
||||
maxDashDuration: 2
|
||||
references:
|
||||
version: 2
|
||||
RefIds: []
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E002_CeilingStrike
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e002_ceiling_strike
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
strikeClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E003_Fall
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e003_fall
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
fallLoopClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
|
||||
@@ -13,11 +13,10 @@ MonoBehaviour:
|
||||
m_Name: ABL_E004_Acid
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e004_acid
|
||||
designNote:
|
||||
attackSequence:
|
||||
- {fileID: 11400000, guid: b0bce0e3cbc007842a69b60d6cf12792, type: 2}
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
@@ -26,3 +25,7 @@ MonoBehaviour:
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E004_Appear
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e004_appear
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
appearClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
|
||||
@@ -13,10 +13,9 @@ MonoBehaviour:
|
||||
m_Name: ABL_E004_Bite
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e004_bite
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
@@ -25,3 +24,7 @@ MonoBehaviour:
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E004_Flip
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e004_flip
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
faceClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E004_HeadSlam
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e004_headslam
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
startClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
|
||||
@@ -13,12 +13,11 @@ MonoBehaviour:
|
||||
m_Name: ABL_E005_Acid
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e005_acid
|
||||
designNote:
|
||||
attackSequence:
|
||||
- {fileID: 11400000, guid: cabdf15fd8ee5c8449c6236751ada4f5, type: 2}
|
||||
- {fileID: 11400000, guid: 800b72bef8e5be446aa56ec4993ba21d, type: 2}
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
@@ -27,3 +26,7 @@ MonoBehaviour:
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
|
||||
@@ -13,10 +13,9 @@ MonoBehaviour:
|
||||
m_Name: ABL_E005_Bite
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e005_bite
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
@@ -25,3 +24,7 @@ MonoBehaviour:
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
|
||||
@@ -13,18 +13,21 @@ MonoBehaviour:
|
||||
m_Name: ABL_E006_Chase
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e006_chase
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
preferredMaxRange: 5
|
||||
requiresLineOfSight: 1
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
startClip:
|
||||
_FadeDuration: 0.25
|
||||
_Speed: 1
|
||||
@@ -53,6 +56,7 @@ MonoBehaviour:
|
||||
_Clip: {fileID: 0}
|
||||
_NormalizedStartTime: NaN
|
||||
dashSpeed: 0
|
||||
maxDashDuration: 2
|
||||
references:
|
||||
version: 2
|
||||
RefIds: []
|
||||
|
||||
@@ -13,10 +13,9 @@ MonoBehaviour:
|
||||
m_Name: ABL_E006_Leap
|
||||
m_EditorClassIdentifier:
|
||||
abilityId: e006_leap
|
||||
designNote:
|
||||
attackSequence: []
|
||||
cooldown: 1.5
|
||||
telegraphVfxKey:
|
||||
telegraphDuration: 0
|
||||
interruptOnHurt: 1
|
||||
interruptOnStagger: 1
|
||||
preferredMinRange: 0
|
||||
@@ -25,3 +24,7 @@ MonoBehaviour:
|
||||
requiresGrounded: 1
|
||||
exclusionGroup:
|
||||
priority: 0
|
||||
category: 0
|
||||
weight: 1
|
||||
rangeRadius: 0
|
||||
rangeOffset: {x: 0, y: 0}
|
||||
|
||||
@@ -2,11 +2,12 @@ namespace BaseGames.Enemies.Abilities
|
||||
{
|
||||
/// <summary>
|
||||
/// 能力执行的阶段枚举(架构 07_EnemyModule §8)。
|
||||
/// 用于 BD/Animator/UI 查询能力当前在哪个阶段(telegraph/出招/恢复)。
|
||||
/// 用于 AI 决策层 / 动画 / UI 查询能力当前在哪个阶段(预警 / 出招 / 恢复)。
|
||||
/// </summary>
|
||||
public enum AbilityRunState
|
||||
{
|
||||
Idle,
|
||||
/// <summary>预警:由能力自身在协程里显式置位(如 BlinkStrikeAbility 的现身闪光)。</summary>
|
||||
Telegraph,
|
||||
Windup,
|
||||
Active,
|
||||
@@ -14,7 +15,7 @@ namespace BaseGames.Enemies.Abilities
|
||||
Interrupted
|
||||
}
|
||||
|
||||
/// <summary>能力中断原因。供 BD 判断是否需要重新调度。</summary>
|
||||
/// <summary>能力中断原因。供 AI 决策层判断是否需要重新调度。</summary>
|
||||
public enum InterruptReason
|
||||
{
|
||||
ExternalRequest,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using Animancer;
|
||||
using BaseGames.Core;
|
||||
using BaseGames.Core.Pool;
|
||||
|
||||
namespace BaseGames.Enemies.Abilities
|
||||
{
|
||||
@@ -114,13 +112,9 @@ namespace BaseGames.Enemies.Abilities
|
||||
private IEnumerator RunInternal()
|
||||
{
|
||||
_isRunning = true;
|
||||
Phase = AbilityRunState.Telegraph;
|
||||
Phase = AbilityRunState.Windup;
|
||||
try
|
||||
{
|
||||
if (_config != null && _config.telegraphDuration > 0f)
|
||||
yield return TelegraphRoutine();
|
||||
|
||||
Phase = AbilityRunState.Windup;
|
||||
yield return ExecuteCoroutine();
|
||||
Phase = AbilityRunState.Recovery;
|
||||
}
|
||||
@@ -137,17 +131,6 @@ namespace BaseGames.Enemies.Abilities
|
||||
/// <summary>子类实现:能力主体。可分多段、含 HitBox 激活/弹幕生成/物理推进等。</summary>
|
||||
protected abstract IEnumerator ExecuteCoroutine();
|
||||
|
||||
/// <summary>预警阶段(默认生成 VFX 后等待 telegraphDuration)。子类可重写。</summary>
|
||||
protected virtual IEnumerator TelegraphRoutine()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_config.telegraphVfxKey))
|
||||
{
|
||||
var pool = ServiceLocator.GetOrDefault<IObjectPoolService>();
|
||||
pool?.Spawn(_config.telegraphVfxKey, _transform.position, Quaternion.identity);
|
||||
}
|
||||
yield return EnemyAbilityWaits.Get(_config.telegraphDuration);
|
||||
}
|
||||
|
||||
/// <summary>能力结束钩子(被中断或正常结束都会调用)。</summary>
|
||||
protected virtual void OnAbilityEnded() { }
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace BaseGames.Enemies.Abilities
|
||||
{
|
||||
/// <summary>
|
||||
/// 能力配置包(架构 07_EnemyModule §8.2)。
|
||||
/// 一个能力 = 一组攻击段 + 公共参数(冷却/预警/中断规则)。
|
||||
/// 一个能力 = 一组攻击段 + 公共参数(冷却/中断规则)。
|
||||
/// 预警不在此配置:预警的载体是动画 clip 本身(姿态在动画里,音效与特效挂动画事件)。
|
||||
/// 由对应 EnemyAbilityBase 子类组件读取并执行。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(menuName = "BaseGames/Enemies/Enemy Ability", fileName = "ABL_")]
|
||||
@@ -27,11 +28,6 @@ namespace BaseGames.Enemies.Abilities
|
||||
[Header("冷却(秒,从能力执行结束开始计)")]
|
||||
[Min(0f)] public float cooldown = 1.5f;
|
||||
|
||||
[Header("预警(Telegraph)")]
|
||||
[Tooltip("预警 VFX key(IObjectPoolService.Spawn 的池 key),为空则跳过")]
|
||||
public string telegraphVfxKey = "";
|
||||
[Min(0f)] public float telegraphDuration = 0f;
|
||||
|
||||
[Header("中断规则")]
|
||||
[Tooltip("受击时是否打断能力(false=能力具霸体)")]
|
||||
public bool interruptOnHurt = true;
|
||||
|
||||
Reference in New Issue
Block a user