Files
zeling_v2/Assets/_Game/Scripts/Enemies/AI/BD_UseBossSkill.cs
Joywayer a1b4e629aa feat: Implement Room Streaming System
- Add RoomStreamingManager to manage room loading and unloading based on player proximity.
- Create StreamingBudgetConfigSO for memory and performance budgeting of the streaming system.
- Introduce TransitionDirector to handle seamless and atmospheric fade transitions between rooms.
- Develop WorldGraph to represent room connectivity and facilitate neighbor queries and distance calculations.
- Implement RoomNode and RoomEdge classes to structure room data and connections.
2026-05-23 19:10:29 +08:00

54 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#if GRAPH_DESIGNER
using UnityEngine;
using Opsive.BehaviorDesigner.Runtime.Tasks;
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
using BaseGames.Boss;
namespace BaseGames.Enemies.AI
{
/// <summary>
/// 触发 Boss 技能。OnStart 调用 BossBase.UseBossSkill(skillId)OnUpdate 等待技能结束。
/// 失败条件:非 Boss 敌人、技能 ID 无效、BossSkillExecutor 未就绪或技能执行中。
/// </summary>
[TaskName("Use Boss Skill")]
[TaskCategory("BaseGames/Enemy/Boss")]
[TaskDescription("通过技能 ID 执行 Boss 指定技能")]
public sealed class BD_UseBossSkill : Action
{
[SerializeField] private string m_SkillId = "";
[Tooltip("可选:直接拖拽 BossSkillSO 资产以替代裸字符串(优先于 m_SkillId")]
[SerializeField] private BossSkillSO m_SkillSO;
private BossBase _boss;
private bool _startedSuccessfully;
public override void OnAwake()
{
_boss = gameObject.GetComponent<BossBase>();
}
public override void OnStart()
{
_startedSuccessfully = false;
if (_boss == null) return;
string id = m_SkillSO != null ? m_SkillSO.skillId : m_SkillId;
if (string.IsNullOrEmpty(id)) return;
_startedSuccessfully = _boss.UseBossSkill(id);
}
public override TaskStatus OnUpdate()
{
if (!_startedSuccessfully || _boss == null) return TaskStatus.Failure;
return _boss.IsBossSkillExecuting ? TaskStatus.Running : TaskStatus.Success;
}
public override void OnEnd()
{
_startedSuccessfully = false;
}
}
}
#endif