채팅 추가

This commit is contained in:
2026-09-01 14:40:02 +09:00
parent cab0d772b1
commit a5a1f1d9e9
50 changed files with 3843 additions and 1124 deletions

View File

@@ -77,10 +77,26 @@ void Start()
#endif
}
// 마지막으로 Esc 종료가 막힌 프레임. 채팅창이 열려 있는 동안 매 프레임 갱신된다.
int escapeSuppressedFrame = -10;
/// <summary>
/// 이번 프레임의 Esc 를 종료로 해석하지 않는다.
///
/// 채팅창처럼 Esc 에 자기 의미가 있는 UI 는 열려 있는 동안 매 프레임 이걸 부른다.
/// 한 프레임 유예를 두는 이유: 채팅창이 Esc 로 닫히면서 억제를 멈춘 바로 그 프레임에
/// 여기서 같은 Esc 를 다시 읽으면 앱이 꺼져버린다. 스크립트 실행 순서에 기대지 않도록
/// 프레임 번호로 판단한다.
/// </summary>
public void SuppressEscapeQuit()
{
escapeSuppressedFrame = Time.frameCount;
}
void Update()
{
// 포커스가 있을 때만 동작하는 보조 탈출구
if (quitOnEscape)
if (quitOnEscape && Time.frameCount - escapeSuppressedFrame > 1)
{
var kb = Keyboard.current;
if (kb != null && kb.escapeKey.wasPressedThisFrame) Application.Quit();