调整linkdoor

This commit is contained in:
2026-05-19 16:04:40 +08:00
parent 0559d2cd36
commit aac24d825f
6 changed files with 410 additions and 72 deletions

View File

@@ -179,6 +179,18 @@ namespace BaseGames.Player
transform.localScale = new Vector3(dir, 1f, 1f);
}
/// <summary>
/// 强制设定朝向,并同步清零速度,确保传送/出生后不被旧速度立即覆盖。
/// dir+1 = 朝右,-1 = 朝左。
/// </summary>
public void SetFacingImmediate(int dir)
{
if (dir == 0) return;
_facingDirection = dir;
transform.localScale = new Vector3(dir, 1f, 1f);
_rb.velocity = Vector2.zero;
}
// ── 取消窗口 ──────────────────────────────────────────────────────────
public void SetCancelWindowOpen(bool open) => _cancelWindowOpen = open;