PD: "여전히 움직이지 않아·실측·근본 원인 체크"
근본 (MCP Play 실측·자성 #12·#13):
- AnimationController field initializer: PlatformerModel model = Simulation.GetModel<PlatformerModel>()
- Editor·Play mode 전환 시 Simulation.GetModel 호출이 인스턴스 컨텍스트 외부에서 실행
- field initializer 영역 NRE/Exception → Component 생성 자체 실패
- Awake/OnEnable 모두 호출 X
- 결과: spriteRenderer/animator/body 모두 NULL
- AnimationController.ComputeVelocity NRE → KinematicObject.Update/FixedUpdate 영역 실행되나
spriteRenderer.flipX/animator.SetFloat 호출 NRE → ComputeVelocity 영역 중단·targetVelocity 미설정
- velocity=0·move=0·Enemy 영구 정지
fix:
1. field initializer 폐기·Awake 영역 try-catch로 안전 초기화
- try { model = Simulation.GetModel<PlatformerModel>(); } catch { model = null; }
2. ComputeVelocity에서 spriteRenderer/animator NULL 가드
3. model NULL 시 jumpModifier=1·jumpDeceleration=0.5 default
검증 (MCP Play):
- 직전: sr=NULL·anim=NULL·body=NULL
- 정정 후: sr=OK·anim=OK·body=OK·IsGrounded=True
회귀 영역 X:
- spriteRenderer/animator GetComponentInChildren fallback 정합
- KinematicObject·EnemyController·patrol·cliffCheck 영역 영역 X
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| Assets | ||
| Packages | ||
| ProjectSettings | ||
| .gitignore | ||
| EerieVillage.slnx | ||