fix(BT12-Dev): Enemy 발판 IgnoreCollision + MonsterRandomizer 6 색상 tint
PD: "몬스터도 발판 자유 통과"
PD: "몬스터 랜덤 변경"
근본 (MCP 자율 실측):
1. Enemy 발판 통과
- Layer 14 (Enemy) ↔ Layer 0 (발판) collide=True → Enemy 발판 영역
- PlatformEffector2D surfaceArc 170°·옆 영역 통과·발판 위 영역 영역
- fix: EnemyController.Awake 영역 PlatformEffector2D 영역 IgnoreCollision 일괄 등록
→ Enemy 16개 × 발판 17개 모두 IgnoreCollision·발판 영역 영역 X·자유 통과
2. 몬스터 랜덤
- 직전 MonsterRandomizer 폐기 (Animator 영역)
- 영역 영역 — 6 Override Controller·24 Clip 신규 영역 영역 영역 영역 영역
- 영역 — SpriteRenderer.color 6 random tint
White·Red·Green·Blue·Yellow·Purple·Awake 1회 random
- Animator (Idle·Run·Hurt·Death) 정합 유지·sprite swap X·tint만 영역
- 영역 영역 영역·영역 영역 영역 영역
회귀 영역 X:
- One-Way Platform·Player 영역 영역 X·Camera·Wall LayerMask·Composite 정합
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
567501ceef
commit
6e774dc375
|
|
@ -89,6 +89,18 @@ namespace Platformer.Mechanics
|
|||
}
|
||||
}
|
||||
|
||||
// BT12-Dev 2026-05-11 — PlatformEffector2D 영역 IgnoreCollision (PD 지시: Enemy 발판 자유 통과)
|
||||
// 발판 17개·Enemy 16개 — Awake 시점 일괄 IgnoreCollision 등록.
|
||||
if (_collider != null)
|
||||
{
|
||||
var platforms = Object.FindObjectsByType<PlatformEffector2D>(FindObjectsSortMode.None);
|
||||
foreach (var platform in platforms)
|
||||
{
|
||||
var platCol = platform.GetComponent<Collider2D>();
|
||||
if (platCol != null) Physics2D.IgnoreCollision(_collider, platCol, true);
|
||||
}
|
||||
}
|
||||
|
||||
// PD 명시 2026-05-08 — 자동 patrol 시작 위치 저장 (측정·target은 Start 시점)
|
||||
_startX = transform.position.x;
|
||||
_startY = transform.position.y; // BT102: 떨어짐 검출 기준
|
||||
|
|
|
|||
|
|
@ -3,21 +3,32 @@ using UnityEngine;
|
|||
namespace Platformer.Mechanics
|
||||
{
|
||||
/// <summary>
|
||||
/// 몬스터 종류 랜덤 영역 — Animator 정합 유지.
|
||||
/// PD 지시 (2026-05-10): Animator 영역 (Idle·Run·Hurt·Death state) 영역 → Animator 활성·sprite 수동 영역 X.
|
||||
/// 6종 random visual 다양성 영역 후속 안건 (Sprite 동적 randomization·6 controller·SubStateMachine).
|
||||
/// 몬스터 종류 랜덤 영역 — 6 색상 random tint·Animator 정합 유지.
|
||||
/// PD 지시 (2026-05-11): 몬스터 랜덤 변경.
|
||||
/// Animator (Idle·Run·Hurt·Death) 영역 + SpriteRenderer.color 6종 random.
|
||||
/// </summary>
|
||||
public class MonsterRandomizer : MonoBehaviour
|
||||
{
|
||||
[Tooltip("6 종 × 4 frame idle sprite (24 sprite·6 group). Awake 시 random group 영역 첫 sprite 영역 영역 영역.")]
|
||||
[Tooltip("이전 호환 — Inspector idle frames 필드 (실제 영역 X·후속 폐기 가능)")]
|
||||
public Sprite[] idleFrames;
|
||||
|
||||
const int FramesPerMonster = 4;
|
||||
// 6 색상 random tint
|
||||
static readonly Color[] _tints = new Color[]
|
||||
{
|
||||
new Color(1.00f, 1.00f, 1.00f), // White (default)
|
||||
new Color(1.00f, 0.50f, 0.50f), // Red
|
||||
new Color(0.50f, 1.00f, 0.50f), // Green
|
||||
new Color(0.50f, 0.70f, 1.00f), // Blue
|
||||
new Color(1.00f, 1.00f, 0.50f), // Yellow
|
||||
new Color(0.85f, 0.50f, 1.00f), // Purple
|
||||
};
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// BT12-Dev 2026-05-10 — Animator 활성 유지 (이전 anim.enabled=false 제거·근본).
|
||||
// sprite 수동 영역 폐기·Animator Clip (EnemyIdle·EnemyRun·EnemyHurt·EnemyDeath) 영역 정합.
|
||||
var sr = GetComponent<SpriteRenderer>();
|
||||
if (sr == null) return;
|
||||
int idx = Random.Range(0, _tints.Length);
|
||||
sr.color = _tints[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue