- 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.
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
#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
|