添加翻转视觉朝向的方法以支持蹬墙跳时的即时转向,并在切换到 WallSlideState 时确保正确刷新抓墙高度
This commit is contained in:
@@ -236,6 +236,17 @@ namespace BaseGames.Player
|
||||
_rb.velocity = Vector2.zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仅翻转视觉朝向,不修改速度。用于蹬墙跳瞬间需要立即转向而不中断跳跃速度的场景。
|
||||
/// dir:+1 = 朝右,-1 = 朝左。
|
||||
/// </summary>
|
||||
public void FlipFacing(int dir)
|
||||
{
|
||||
if (dir == 0 || dir == _facingDirection) return;
|
||||
_facingDirection = dir;
|
||||
transform.localScale = new Vector3(dir, 1f, 1f);
|
||||
}
|
||||
|
||||
// ── 取消窗口 ──────────────────────────────────────────────────────────
|
||||
public void SetCancelWindowOpen(bool open) => _cancelWindowOpen = open;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user