docs(BT12-Dev-Vis): Projectile unscaledTime·자성 #11 (엔트리 23)

EerieVillage 705d943 push 정합.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-05-13 20:21:55 +09:00
parent 3f20a1da65
commit 2d86eb0171
2 changed files with 21 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -576,6 +576,26 @@ PlayerDeath.Execute 영역 `y -0.3` → `y -0.6`.
---
## 엔트리 23 — Projectile unscaledTime — Time.timeScale=0 영역 영구 잔존 차단 (2026-05-13 EerieVillage `705d943`)
**PD 보고**: "게임을 재시작할 때마다 이동하지 않고 생성 된 투사체가 계속 쌓이는 것 같아."
**근본 원인 측정**:
- 첫 발사 직후 LevelUp 발생 또는 Player 사망 등 영역 → `Time.timeScale = 0` 활성
- `Invoke(nameof(SelfDestruct), _lifetime)` 영역 = Time.timeScale 영향 영역 → timeScale=0 시 호출 정지
- `_spawnTime = Time.time` 영역 = timeScale=0 시 Time.time 정지 → backup check 영역 영역 X → **영구 잔존**
- Play → Stop → Play 영역 매번 누적 가능성 영역 (HideFlags.DontSave 정합 영역 영역 영역 → 본 원인 X·재시작 시 새 누적)
**fix** (Projectile.cs):
- `_spawnTime = Time.unscaledTime` (timeScale 무관)
- Update 영역 `Time.unscaledTime - _spawnTime > _lifetime` 영역 강제 SelfDestruct
- Wall grace period 영역 unscaledTime 정합
- `Invoke(SelfDestruct, _lifetime)` 폐기·`CancelInvoke()` 추가 안전 (이전 잔존 Invoke 영역 차단)
**본 PM 자성 #11** — `feedback_new_code_existing_system_dependency_unmeasured` 위반. Projectile lifecycle 영역 `Time.timeScale` 영향 영역 사전 측정 누락. 재발 방지: 시간 관련 (Time.time·Time.deltaTime·Invoke) 호출 시 timeScale=0 시나리오 사전 측정 의무 (LevelUp·일시정지·Death Pause 등).
---
## 영역 자산
- `HitboxDebug.cs` 공용 helper (Spawn·AttachToTransform·GetWhiteSprite) — 추후 다른 카테고리 (C 설치·D 소환·E 오라) 영역 박스 시각화 재사용 가능.