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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#if GRAPH_DESIGNER
|
||||
#if GRAPH_DESIGNER
|
||||
using UnityEngine;
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks;
|
||||
using Opsive.BehaviorDesigner.Runtime.Tasks.Conditionals;
|
||||
@@ -7,36 +7,23 @@ using BaseGames.Enemies;
|
||||
namespace BaseGames.Enemies.AI
|
||||
{
|
||||
/// <summary>
|
||||
/// BD Conditional:敌人当前 EnemyStateType 是否与目标状态名称匹配。
|
||||
/// TargetStateName 直接输入枚举名称字符串(Controlled / Hurt / Stagger / Dead),
|
||||
/// 枚举值顺序变化时 BD 图不会静默失效。
|
||||
/// BD Conditional:敌人当前 EnemyStateType 是否与目标状态匹配。
|
||||
/// </summary>
|
||||
[TaskName("Is State Match?")]
|
||||
[TaskCategory("BaseGames/Enemy/State")]
|
||||
[TaskDescription("检查当前物理/战斗状态是否与目标枚举值匹配")]
|
||||
public class BD_IsStateMatch : Conditional
|
||||
{
|
||||
/// <summary>目标状态名称(Controlled / Hurt / Stagger / Dead)。</summary>
|
||||
[SerializeField] private string m_TargetStateName = "Controlled";
|
||||
[SerializeField] private EnemyStateType m_TargetState = EnemyStateType.Controlled;
|
||||
|
||||
private EnemyBase _enemy;
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
_enemy = GetComponent<EnemyBase>();
|
||||
}
|
||||
public override void OnAwake() => _enemy = GetComponent<EnemyBase>();
|
||||
|
||||
public override TaskStatus OnUpdate()
|
||||
{
|
||||
if (_enemy == null) return TaskStatus.Failure;
|
||||
|
||||
if (!System.Enum.TryParse<EnemyStateType>(m_TargetStateName, out var target))
|
||||
{
|
||||
Debug.LogError($"[BD_IsStateMatch] 未知状态名: '{m_TargetStateName}'," +
|
||||
"有效值为 Controlled / Hurt / Stagger / Dead", gameObject);
|
||||
return TaskStatus.Failure;
|
||||
}
|
||||
|
||||
return _enemy.CurrentState == target
|
||||
? TaskStatus.Success
|
||||
: TaskStatus.Failure;
|
||||
return _enemy.CurrentState == m_TargetState ? TaskStatus.Success : TaskStatus.Failure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user