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,7 +1,27 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BaseGames.Enemies
|
||||
{
|
||||
/// <summary>
|
||||
/// 受击分级配置(KnockUp 击飞门槛 & 飞行参数)。
|
||||
/// 挂载在 EnemyStatsSO.HitTiers 中。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct HitTierConfig
|
||||
{
|
||||
[Tooltip("重击(Stagger)触发伤害阈值;伤害 >= 此值进入 Stagger")]
|
||||
[Min(0)] public int heavyHitThreshold;
|
||||
[Tooltip("击飞(KnockUp)触发伤害阈值;需同时设置 DamageFlags.Launch;0 = 仅依赖 Launch 标志")]
|
||||
[Min(0)] public int launchThreshold;
|
||||
[Tooltip("击飞纵向冲量")]
|
||||
[Min(0f)] public float launchUpForce;
|
||||
[Tooltip("击飞横向冲量(沿受击反方向)")]
|
||||
[Min(0f)] public float launchHorzForce;
|
||||
[Tooltip("无 KnockUp 动画时的状态持续时长(s)")]
|
||||
[Min(0f)] public float knockUpDuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 敌人属性配置 SO(架构 07_EnemyModule §2)。
|
||||
/// </summary>
|
||||
@@ -9,29 +29,55 @@ namespace BaseGames.Enemies
|
||||
public class EnemyStatsSO : ScriptableObject
|
||||
{
|
||||
[Header("生命")]
|
||||
public int MaxHP = 50;
|
||||
[Min(1)] public int MaxHP = 50;
|
||||
|
||||
[Header("防御")]
|
||||
public int Defense = 0;
|
||||
[Min(0)] public int Defense = 0;
|
||||
|
||||
[Header("移动")]
|
||||
public float WalkSpeed = 2f;
|
||||
public float RunSpeed = 4f;
|
||||
[Min(0f)] public float WalkSpeed = 2f;
|
||||
[Min(0f)] public float RunSpeed = 4f;
|
||||
|
||||
[Header("战斗")]
|
||||
public int AttackDamage = 10;
|
||||
public float AttackRange = 1.5f;
|
||||
public float AttackCooldown = 1f;
|
||||
public float DetectRange = 6f;
|
||||
[Min(0)] public int AttackDamage = 10;
|
||||
[Min(0f)] public float AttackRange = 1.5f;
|
||||
[Min(0f)] public float AttackCooldown = 1f;
|
||||
[Min(0f)] public float DetectRange = 6f;
|
||||
|
||||
[Header("追击 & AI 阶段")]
|
||||
[Tooltip("最大追击距离(m);超出后放弃追击切换搜查阶段")]
|
||||
[Min(0f)] public float MaxChaseDistance = 15f;
|
||||
[Tooltip("视线丢失判定超时(s);超过此时长无视线则切换搜查")]
|
||||
[Min(0f)] public float LoseLinkTimeout = 2f;
|
||||
[Tooltip("Alert 阶段持续时长(s);短暂警觉动作后进入追击")]
|
||||
[Min(0f)] public float AlertDuration = 0.6f;
|
||||
[Tooltip("搜查最后可见位置后的等待时长(s)")]
|
||||
[Min(0f)] public float InvestigateDuration = 3f;
|
||||
[Tooltip("归位到达判定半径(m)")]
|
||||
[Min(0.01f)] public float HomeRadius = 0.5f;
|
||||
|
||||
[Header("击退(作为来源时)")]
|
||||
public float KnockbackForce = 5f;
|
||||
public float HitStunDuration = 0.3f;
|
||||
[Min(0f)] public float KnockbackForce = 5f;
|
||||
[Min(0f)] public float HitStunDuration = 0.3f;
|
||||
|
||||
[Header("受击分级")]
|
||||
[Tooltip("Stagger / KnockUp 伤害阈值及击飞参数")]
|
||||
public HitTierConfig HitTiers;
|
||||
|
||||
[Header("视线检测(BatchLOSSystem)")]
|
||||
[Tooltip("相对 transform.position 的眼睛偏移量")]
|
||||
public Vector2 EyeOffset = new Vector2(0f, 0.8f);
|
||||
[Tooltip("遮挡 LOS 的物理图层")]
|
||||
public LayerMask LOSBlockingMask = 1; // Default layer
|
||||
|
||||
[Header("感知角度")]
|
||||
[Tooltip("前向感知扇形半角(度)。0 = 关闭方向检查,按完整圆形感知")]
|
||||
[Range(0f, 180f)]
|
||||
public float DetectAngleDeg = 0f;
|
||||
|
||||
[Header("警戒传播(Group Alert)")]
|
||||
[Tooltip("发现玩家时通知周围同伴进入 Alert 的半径(m);0 = 关闭")]
|
||||
[Min(0f)]
|
||||
public float AlertBroadcastRadius = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user