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:
40
Assets/_Game/Scripts/Enemies/States/EnemyKnockUpState.cs
Normal file
40
Assets/_Game/Scripts/Enemies/States/EnemyKnockUpState.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace BaseGames.Enemies.States
|
||||
{
|
||||
/// <summary>
|
||||
/// 击飞腾空状态:施加击飞冲量,播放 KnockUp 动画直至落地/动画结束后恢复 Controlled。
|
||||
///
|
||||
/// 触发条件:TakeDamage 检测到 DamageFlags.Launch + 伤害 >= launchThreshold。
|
||||
/// 来袭方向由 <see cref="EnemyBase.PendingLaunchDir"/> 提供。
|
||||
/// 若 AnimConfig 无 KnockUp Clip,则通过 <see cref="EnemyBase.ScheduleStateRecovery"/> 按时长兜底恢复。
|
||||
/// </summary>
|
||||
public sealed class EnemyKnockUpState : IEnemyState
|
||||
{
|
||||
public EnemyStateType StateType => EnemyStateType.KnockUp;
|
||||
|
||||
public void Enter(EnemyBase owner)
|
||||
{
|
||||
var cfg = owner.StatsSO?.HitTiers ?? default;
|
||||
|
||||
// 施加击飞冲量
|
||||
owner.Movement?.LaunchKnockup(owner.PendingLaunchDir, cfg.launchHorzForce, cfg.launchUpForce);
|
||||
|
||||
if (owner.Animancer != null && owner.AnimConfig?.KnockUp != null)
|
||||
{
|
||||
var animState = owner.Animancer.Play(owner.AnimConfig.KnockUp);
|
||||
animState.Events(owner).OnEnd = () =>
|
||||
{
|
||||
if (owner.CurrentState == EnemyStateType.KnockUp)
|
||||
owner.ForceState(EnemyStateType.Controlled);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// 无 KnockUp 动画:按配置时长自动恢复
|
||||
float duration = cfg.knockUpDuration > 0f ? cfg.knockUpDuration : 0.5f;
|
||||
owner.ScheduleStateRecovery(EnemyStateType.KnockUp, duration);
|
||||
}
|
||||
}
|
||||
|
||||
public void Exit(EnemyBase owner) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 916cc14ff8ec787438042a7982768b9b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user