From 60c2e9bf097032eb6e5a54fc55a11aff40f44dac Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 15 May 2026 00:31:55 +0900 Subject: [PATCH] =?UTF-8?q?fix(BT12-Dev):=20=EB=B0=95=EC=A5=90=20IsFlying?= =?UTF-8?q?=20Animator=20name=20=EC=9E=90=EB=8F=99=20=EA=B0=90=EC=A7=80=20?= =?UTF-8?q?(PD=20=EC=A7=84=EB=8B=A8=202026-05-15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 추가 보고 + 스크린샷: "여전히 박쥐 몬스터가 공중에 떠있지 않고 움직이지도 않아" 진단 결과: Enemy.prefab 영역 MonsterRandomizer 부착 X · Animator 직접 M002.overrideController 부착. 직전 commit 6be8ccd 의 MonsterRandomizer flyingFlags / name fallback 영역 발화 X → IsFlying=False 잔존 → gravity·collide 정상 적용 → 박쥐 지상 정지. 정정: - EnemyController.Awake 영역 Animator.runtimeAnimatorController.name "M002" 포함 시 IsFlying=true 자동 set - 기존 MonsterRandomizer name fallback 도 보존 (랜덤 케이스 대비) 검증 (Play 모드): - Enemy 16기 중 박쥐 3기 모두 IsFlying=True·ignoreCollisions=True· gravMod=0 자동 set - 1기 velocity=(-3.50, 0) patrol 이동 중·2~3기 wait 상태 정합 Co-Authored-By: Claude Opus 4.7 (1M context) --- Assets/Scripts/Mechanics/EnemyController.cs | 12 ++++++++++++ Assets/Scripts/Mechanics/MonsterRandomizer.cs | 9 +++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Mechanics/EnemyController.cs b/Assets/Scripts/Mechanics/EnemyController.cs index 1f52380..46c25d3 100644 --- a/Assets/Scripts/Mechanics/EnemyController.cs +++ b/Assets/Scripts/Mechanics/EnemyController.cs @@ -105,6 +105,18 @@ namespace Platformer.Mechanics // Layer 14 (Enemy) ↔ Layer 14 collide X·전역 1회 적용 (Awake 영역 매번 호출 무관·idempotent). Physics2D.IgnoreLayerCollision(14, 14, true); + // PD 지시 2026-05-15 — Animator.runtimeAnimatorController name 영역 M002 (박쥐) 영역 IsFlying=true 자동 + // (MonsterRandomizer 부재·Animator 직접 controller 부착 케이스 보강) + if (!IsFlying) + { + var anim = GetComponent(); + if (anim != null && anim.runtimeAnimatorController != null + && anim.runtimeAnimatorController.name.Contains("M002")) + { + IsFlying = true; + } + } + // PD 지시 2026-05-15 — 날으는 몬스터 영역 중력 무효 + collide 무시 (이동 정합) if (IsFlying && control != null) { diff --git a/Assets/Scripts/Mechanics/MonsterRandomizer.cs b/Assets/Scripts/Mechanics/MonsterRandomizer.cs index d18feda..86c25c8 100644 --- a/Assets/Scripts/Mechanics/MonsterRandomizer.cs +++ b/Assets/Scripts/Mechanics/MonsterRandomizer.cs @@ -26,10 +26,15 @@ namespace Platformer.Mechanics var anim = GetComponent(); if (anim == null) return; int idx = Random.Range(0, overrideControllers.Length); - anim.runtimeAnimatorController = overrideControllers[idx]; + var selected = overrideControllers[idx]; + anim.runtimeAnimatorController = selected; // PD 지시 2026-05-15 — 박쥐 선택 시 EnemyController.IsFlying=true 자동 set - if (flyingFlags != null && idx < flyingFlags.Length && flyingFlags[idx]) + // flyingFlags Inspector 설정 우선 · 미설정 시 controller name fallback (M002 = 박쥐) + bool isFlying = false; + if (flyingFlags != null && idx < flyingFlags.Length && flyingFlags[idx]) isFlying = true; + else if (selected != null && selected.name.Contains("M002")) isFlying = true; + if (isFlying) { var ec = GetComponent(); if (ec != null) ec.IsFlying = true;