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