优化 FallState 和 WallSlideState 的状态切换逻辑,增加对 WallCling 能力的检查,并在抓墙时恢复空中冲刺次数
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace BaseGames.Player.States
|
||||
if (AnimCfg?.WallSlide != null)
|
||||
Anim?.Play(AnimCfg.WallSlide);
|
||||
|
||||
// 抓墙时恢复空中冲刺次数(与蹬墙跳一致)
|
||||
Owner.GetState<DashState>()?.ResetDashCharge();
|
||||
|
||||
// 消耗蹬墙跳后的自动抓墙标记
|
||||
Owner.SetPostWallJump(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user