优化 WallSlideState 切换逻辑,增加对 WallCling 能力的检查以提升角色在墙壁附近的交互体验
This commit is contained in:
@@ -97,7 +97,8 @@ namespace BaseGames.Player.States
|
|||||||
int wallDir = wd.WallDirection;
|
int wallDir = wd.WallDirection;
|
||||||
bool pressingTowardWall = Mathf.Abs(Input.MoveInput.x) > 0.01f
|
bool pressingTowardWall = Mathf.Abs(Input.MoveInput.x) > 0.01f
|
||||||
&& (int)Mathf.Sign(Input.MoveInput.x) == wallDir;
|
&& (int)Mathf.Sign(Input.MoveInput.x) == wallDir;
|
||||||
if (pressingTowardWall || Owner.IsPostWallJump)
|
if ((pressingTowardWall || Owner.IsPostWallJump)
|
||||||
|
&& Stats != null && Stats.HasAbility(AbilityType.WallCling))
|
||||||
{
|
{
|
||||||
_owner.TransitionTo(_owner.GetState<WallSlideState>());
|
_owner.TransitionTo(_owner.GetState<WallSlideState>());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ namespace BaseGames.Player.States
|
|||||||
int wallDir = wd.WallDirection;
|
int wallDir = wd.WallDirection;
|
||||||
bool pressingTowardWall = Mathf.Abs(Input.MoveInput.x) > 0.01f
|
bool pressingTowardWall = Mathf.Abs(Input.MoveInput.x) > 0.01f
|
||||||
&& (int)Mathf.Sign(Input.MoveInput.x) == wallDir;
|
&& (int)Mathf.Sign(Input.MoveInput.x) == wallDir;
|
||||||
if (pressingTowardWall || Owner.IsPostWallJump)
|
if ((pressingTowardWall || Owner.IsPostWallJump)
|
||||||
|
&& Stats != null && Stats.HasAbility(AbilityType.WallCling))
|
||||||
{
|
{
|
||||||
_owner.TransitionTo(_owner.GetState<WallSlideState>());
|
_owner.TransitionTo(_owner.GetState<WallSlideState>());
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user