- 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.
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
#if GRAPH_DESIGNER
|
||
using UnityEngine;
|
||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||
using Opsive.BehaviorDesigner.Runtime.Tasks.Actions;
|
||
using BaseGames.Enemies;
|
||
|
||
namespace BaseGames.Enemies.AI
|
||
{
|
||
/// <summary>
|
||
/// BD Action:跳跃至目标坐标(抛物线跳跃)。
|
||
/// 调用 EnemyBase.JumpTo,待落地(IsGrounded)后返回 Success。
|
||
/// </summary>
|
||
[TaskName("Jump To")]
|
||
[TaskCategory("BaseGames/Enemy/Movement")]
|
||
[TaskDescription("执行跳跃动作到达目标高度或 NavLink 对接点")]
|
||
public class BD_JumpTo : Action
|
||
{
|
||
[SerializeField] private Vector2 m_Target;
|
||
|
||
private EnemyBase _enemy;
|
||
private bool _jumped;
|
||
|
||
public override void OnAwake() => _enemy = GetComponent<EnemyBase>();
|
||
|
||
public override void OnStart()
|
||
{
|
||
_jumped = false;
|
||
}
|
||
|
||
public override TaskStatus OnUpdate()
|
||
{
|
||
if (_enemy == null) return TaskStatus.Failure;
|
||
|
||
if (!_jumped)
|
||
{
|
||
_enemy.JumpTo(m_Target);
|
||
_jumped = true;
|
||
return TaskStatus.Running;
|
||
}
|
||
|
||
// 等待落地
|
||
if (_enemy.Movement != null && _enemy.Movement.IsGrounded)
|
||
return TaskStatus.Success;
|
||
|
||
return TaskStatus.Running;
|
||
}
|
||
}
|
||
}
|
||
#endif
|