feat(BT12-Dev): 공중 몬스터 flyingYOffset Inspector 신설 (PD 지시 2026-05-15)

PD 결정: "B안으로 진행해" (Inspector 단일 수치·전 박쥐 일괄·확장 일관)

EnemyController.flyingYOffset float Inspector (기본 2f) 신설.
IsFlying=true 첫 set 시 transform.position.y += flyingYOffset 자동
적용 (_flyingOffsetApplied flag 영역 중복 적용 차단).

- Awake / Start / MonsterRandomizer.Awake 영역 다중 호출 케이스에서도
  1회만 적용
- Rigidbody2D.position 동시 갱신 (KinematicObject 정합)
- _startY 갱신 (fallThreshold 기준점·IsFlying=true 영역 skip 안전망)

검증 (Play 모드):
- 박쥐 3기 모두 flyingYOffset=2 적용
- pos.y: -2.00·-1.90·-1.90 → 0.00·0.10·0.10 (지면 +2 정합)

PD Inspector flyingYOffset 영역 수치 조절로 박쥐 높이 변경 가능.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-05-15 08:33:19 +09:00
parent 190c96918b
commit 7c0aaf341c
1 changed files with 15 additions and 0 deletions

View File

@ -22,6 +22,11 @@ namespace Platformer.Mechanics
// 기본값 M002 (박쥐). 추가 공중 몬스터 영역 PD Inspector 영역 영역.
public string[] flyingControllerNames = new[] { "M002" };
// PD 지시 2026-05-15 — 공중 몬스터 spawn 시 y offset (지면 위로 띄우는 높이)
// IsFlying=true 첫 set 시 transform.position.y += flyingYOffset 자동 적용 (1회만).
public float flyingYOffset = 2f;
bool _flyingOffsetApplied = false;
// BT12-Dev 2026-05-11 — 밟기 공격 기능 제거 (PD 지시): hitRangeX·hitRangeY·stompMinDy 폐기.
// Enemy는 Player 공격에만 피해를 받으므로 Player ↔ Enemy 충돌 감지 자체 불필요.
@ -166,6 +171,16 @@ namespace Platformer.Mechanics
control.gravityModifier = 0f;
control.velocity = Vector2.zero;
control.ignoreCollisions = true;
// PD 지시 2026-05-15 — 첫 IsFlying 적용 시 y offset 1회 (중복 적용 차단)
if (!_flyingOffsetApplied && flyingYOffset > 0f)
{
transform.position += new Vector3(0f, flyingYOffset, 0f);
var body = GetComponent<Rigidbody2D>();
if (body != null) body.position = transform.position;
_startY = transform.position.y; // fallThreshold 기준점 갱신 (IsFlying=true 영역 skip 영역 영역 안전)
_flyingOffsetApplied = true;
}
}
}