优化 FallState 和 WallSlideState 的状态切换逻辑,增加对 WallCling 能力的检查,并在抓墙时恢复空中冲刺次数

This commit is contained in:
2026-05-22 11:01:09 +08:00
parent 68d4c699ae
commit d3136266d1
2 changed files with 9 additions and 1 deletions

View File

@@ -112,7 +112,12 @@ namespace BaseGames.Player.States
if ((pressingTowardWall || Owner.IsPostWallJump)
&& Stats != null && Stats.HasAbility(AbilityType.WallCling))
{
_owner.TransitionTo(_owner.GetState<WallSlideState>());
var wss = _owner.GetState<WallSlideState>();
if (wss != null)
{
wss.PrepareEnter(wallDir);
_owner.TransitionTo(wss);
}
return;
}
}

View File

@@ -73,6 +73,9 @@ namespace BaseGames.Player.States
if (AnimCfg?.WallSlide != null)
Anim?.Play(AnimCfg.WallSlide);
// 抓墙时恢复空中冲刺次数(与蹬墙跳一致)
Owner.GetState<DashState>()?.ResetDashCharge();
// 消耗蹬墙跳后的自动抓墙标记
Owner.SetPostWallJump(false);