3D_Squad_Swarm — 상태머신으로 쌓아 올린 라운드형 좀비 액션
작은 맵에서 플레이어(좀비) vs NPC가 빠르게 부딪히는 3D 라운드 액션.
상태머신(FSM) 아키텍처, NavMesh AI, Stage·UI·Audio 매니저 계층으로 구성.
- 캐릭터 전부 FSM으로 설계(플레이어·NPC·좀비)
- 제한시간/감염도 게이지가 핵심 규칙
- StageConfig(SO)로 난이도·스폰 제어, UI는 상태 전환 파이프라인
- NavMesh + Obstacle로 길막을 네비 데이터에서 보장
▶️ 플레이영상
🕹️ 플레이방법
- 실행하면 Intro → StageSelect → Game 순으로 진입
- 제한시간 안에 적을 처치하여 감염도를 채우면 GameClear
- 시간 초과는 TimeUP, 플레이어 사망은 GameOver
- 일시정지는 Pause(예: ESC)
입력 바인딩은 Unity Input System의 PlayerInput 에셋에서 관리.
✨ Features
- 상태머신 기반 캐릭터 로직
- 공통 FSM: StateMachine.cs
- Player: PlayerStateMachine + PlayerIdle/Walk/Ground/Attack/Death
- NPC: NPCBaseState, NPCAttackState (Idle/Chase/Flee/Death 포함)
- Zombie(Follower/Charging): ZombieStateMachine + ZombieIdle/Follow/Chasing/Charge/Attack/Death/Rise
- Stage 시스템 & 스폰
- StageConfig(ScriptableObject) → StageManager + StageSpawner
- 씬·스폰·타이머·네비 설정을 SO로 일괄 관리
- UI 파이프라인
- UIManager가 Intro/StageSelect/Game/Pause/GameOver/GameClear/TimeUP 전환
- 타이머는 코루틴 핸들 보관으로 중복 실행 방지
- 전투/인터랙션
- IDamageable, Bullet, GunAimer, ForceReciever
- 애니메이션 이벤트: AnimationEventForwarder, NPCAnimationEventForwarder
- 오디오/카메라
- AudioManager, BGMVolumeController, SoundEffect
- CameraManager + CameraDeathEffect, CameraOcclusion
🧩 설계 & 디자인패턴
- State Pattern(FSM): 각 도메인(플레이어/NPC/좀비)에 독립 FSM. Enter/Exit/Update 수명주기.
- Singleton<T>: GameManager / StageManager / UIManager / AudioManager 등 전역 매니저 계층.
- ScriptableObject 주입: StageConfig, ScriptableStats → 런타임에 StageManager/StatHandler가 적용.
- Event-Driven: 스테이지 시작/종료/컷신 신호를 이벤트로 브로드캐스트.
- NavMesh 중심 설계: 경로/차단을 네비 데이터로 일관되게 처리(Obstacle/Carving 포함).
🛠️ 사용기술 & 시스템
- Unity(LTS), C#
- NavMesh: NavMeshAgent, NavMeshObstacle(Carving), NavMesh 샘플링 스폰
- Input System: PlayerInput 액션 맵
- UGUI: Canvas/UI 화면 전환·게이지
- Cinemachine(선택): 가상 카메라/우선도
- Coroutines: 타이머·페이드·스폰 루프
- ScriptableObject: 스테이지/스탯 파라미터화
📂 폴더 구조(요약, 실제 프로젝트 기준)
02. Scripts
├─ AnimationForwarder
│ ├─ AnimationEventForwarder.cs
│ └─ NPCAnimationEventForwarder.cs
│
├─ Base
│ ├─ StateMachine
│ │ └─ StateMachine.cs
│ ├─ Ui
│ │ └─ BaseUI.cs
│ └─ Zombie
│ └─ BaseZombie.cs
│
├─ Camera
│ ├─ CameraDeathEffect.cs
│ └─ CameraOcclusion.cs
│
├─ ForceReciever
│ └─ ForceReciever.cs
│
├─ Interface
│ └─ Attack
│ └─ IDamageable.cs
│
├─ Manager
│ ├─ Player
│ │ └─ PlayerManager.cs
│ ├─ Stage
│ │ └─ StageManager.cs
│ ├─ UI
│ │ └─ UIManager.cs
│ ├─ Util
│ │ ├─ AudioManager.cs
│ │ └─ CameraManager.cs
│ └─ Zombie
│ └─ ZombieManager.cs
│
├─ NPC
│ ├─ Gun
│ │ ├─ Bullet.cs
│ │ └─ GunAimer.cs
│ └─ StateMachin
│ ├─ NPCAttackState.cs
│ ├─ NPCBaseState.cs
│ ├─ NPCChaseState.cs
│ ├─ NPCDeathState.cs
│ ├─ NPCFleeState.cs
│ ├─ NPCGroundState.cs
│ ├─ NPCIdleState.cs
│ ├─ NPCStateMachine.cs
│ └─ NPCTest.cs
│
├─ Player
│ ├─ Anim
│ │ └─ PlayerAnimationData.cs
│ ├─ StateMachine
│ │ ├─ PlayerAttackState.cs
│ │ ├─ PlayerBaseState.cs
│ │ ├─ PlayerDeathState.cs
│ │ ├─ PlayerGroundState.cs
│ │ ├─ PlayerIdleState.cs
│ │ ├─ PlayerStateMachine.cs
│ │ └─ PlayerWalkState.cs
│ ├─ EnemyPointer.cs
│ ├─ Player.cs
│ └─ PlayerController.cs
│
├─ ScriptableObjects
│ └─ Stage
│ └─ StageConfig.cs
│
├─ Singleton
│ ├─ BGMVolumeController.cs
│ ├─ Singleton.cs
│ └─ SoundEffect.cs
│
├─ Spawner
│ ├─ Player
│ │ └─ PlayerSpawner.cs
│ └─ Stage
│ └─ StageSpawner.cs
│
├─ Stats
│ ├─ ScriptableStats.cs
│ └─ StatHandler.cs
│
├─ UI
│ ├─ Billboard
│ │ └─ Billboard.cs
│ ├─ Effect
│ │ └─ HoverEffect.cs
│ ├─ Game
│ │ ├─ GameClearUI.cs
│ │ ├─ GameOverSkipButton.cs
│ │ ├─ GameOverTimeline.cs
│ │ ├─ GameOverUI.cs
│ │ ├─ GameUI.cs
│ │ ├─ MoveArrow.cs
│ │ └─ MoveArrow1.cs
│ ├─ Handle
│ │ └─ HandleAnimationController.cs
│ ├─ Intro
│ │ ├─ IntroSkipButton.cs
│ │ ├─ IntroTimeline.cs
│ │ └─ IntroUI.cs
│ ├─ Stage
│ │ └─ StageSelectUI.cs
│ └─ Util
│ ├─ OptionUI.cs
│ ├─ PauseUI.cs
│ └─ TimeUPUI.cs
│
└─ Zombie
├─ Charging
│ └─ ChargingZombie.cs
└─ FollowerZombie
├─ FollowerZombie.cs
└─ StateMachine
├─ ZombieAttackState.cs
├─ ZombieBaseState.cs
├─ ZombieChargeState.cs
├─ ZombieChasingState.cs
├─ ZombieDeathState.cs
├─ ZombieFollowState.cs
├─ ZombieIdleState.cs
├─ ZombieRiseState.cs
└─ ZombieStateMachine.cs
🧯 트러블슈팅
🎮 개발자, 기획자
개발자 : 이재은, 박정현, 박민제, 임성준
기획자 :김노아, 황의영
🎮 개발기간
개발기간 :(2025.09.01~09.05)
나머지는 영상에 나와있습니다!
🧯 Troubleshooting
'Unity' 카테고리의 다른 글
Unity - TopDown 레이싱 방치형 RPG (2) | 2025.08.29 |
---|---|
Unity - Project_Up (3) | 2025.08.13 |
Unity - 3D Survival Game(인벤토리 기능) (6) | 2025.08.08 |
Unity - Inventory 인벤토리 시스템 구현 정리 (3) | 2025.08.07 |
Unity - Unity의 TryGetComponent (1) | 2025.08.07 |