Files
zeling_v2/Assets/_Game/Scripts/Enemies/AI/BD_IsOnNavLink.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

36 lines
1.3 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.Conditionals;
using BaseGames.Enemies;
namespace BaseGames.Enemies.AI
{
/// <summary>
/// 条件NavAgent 当前是否正在穿越连接段(跳跃/下落/爬梯/传送等)。
/// 可选过滤具体连接类型(填 None = 任意类型均匹配)。
/// </summary>
[TaskName("Is On NavLink?")]
[TaskCategory("BaseGames/Enemy/State")]
[TaskDescription("检查 NavAgent 当前是否正在穿越 NavLink如跳跃传送门")]
public sealed class BD_IsOnNavLink : Conditional
{
[Tooltip("填 None 匹配任意类型;填具体类型则只在该类型时 Success。")]
[SerializeField] private NavLinkType m_FilterType = NavLinkType.None;
private EnemyBase _enemy;
public override void OnAwake() => _enemy = gameObject.GetComponent<EnemyBase>();
public override TaskStatus OnUpdate()
{
if (_enemy?.Nav == null) return TaskStatus.Failure;
if (!_enemy.Nav.IsOnLink) return TaskStatus.Failure;
if (m_FilterType != NavLinkType.None && _enemy.Nav.CurrentLinkType != m_FilterType)
return TaskStatus.Failure;
return TaskStatus.Success;
}
}
}
#endif