Kim jaesik 5주#24
Open
KimJ6 wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경점 👍
playercontroller 리팩토링 - 기능을 분리하여 대체
PlayerMovement : 이동 기능만 분리 (계수 조정과 조작감 개선은 다음에...ㅜㅜ)
PlayerExp : 레벨 경험치 리 기능 분리
팩션 구현
Faction : 객체의 팩션 정의
FactionType : 팩션의 종류, 상관관계 정의와 반환
체력 구현
Hp : 체력 및 피격 판정 기능 추가 (발사체 등의 공격 대상 판정에서 수가 적은 피격 대상으로 판정 주체 변경), 사망치 경험치 생성, 플레이어와 적 모두 사용할 수 있게 팩션은 객체의 속성을 따름
-상속-PlayerHp : Hp를 플레이어용으로 오버라이드
무기 리팩토링 - 플레이어와 적 모두 사용할 수 있게 변경, 플레이어와 적 적대 객체 참조 방식 enum 팩션으로 통일 (확장성, 통일성을 위해서 태그, 싱글톤 참조 방식에서 변경)
AttackData : 공격 정보 정의 클래스
StatusReceiver : 상태 이상을 전달받을 함수
TargetManager : 호출 객체의 적대 팩션 객체를 탐색하여 반환
TurretRotator : TargetManager를 통해 지정 범위, 지정 주기로 타겟 탐색, 전달 받은 위치를 향해 회전 - Turret_Addon의 리팩토링, 적 탐색 회전 기능의 분리
ProjectileBase : 발사체 베이스 클래스
-상속-BulletProjectile : Bullet의 리팩토링
-상속-MissileProjectile : Missile의 리팩토링
-상속-EngeryWaveProjectile : EngeryWave의 리팩토링
WeaponBase : 발사대 베이스 클래스, 오디오 클립 재생 기능 추가, 팩션은 종속 객체를 따름, 같은 객체의 컴포넌트인 AttackData에서 정의된 데이터 ProjectileBase에 전달 (해야하는데... 버그에 후술)
-상속-TurretShooter: Turret_Addon의 리팩토링, 프리팹 발사 기능의 분리
-상속-MissileShooter: MissileLuancher의 리팩토링, 지정한 갯수와 각도로 발사되게 오버라이드
-상속-EnergyWaveShooter: EnergyWaveCannon의 리팩토링
적 리팩토링 - 통합 매니저를 이용해서 전체 Enemy 팩션의 객체 제어하도록 구성, 편대 구성은 시도하였으나 미완성
EnemyManager : 적 객체의 리스트 관리, 해당 리스트 객체들의 제어
EnemyState : 적의 상태(EnemyState)와 적의 종류별 전략 패턴(EnemyBehaviorType)를 나누어 명시
IEnemyStrategy 적의 상태 변화 인터페이스
-상속-SimpleChaseStrategy : 단순 플레이어를 추적하는 적 패턴의 클래스
-상속-ChaseAndFireStrategy : 원거리 적 패턴의 클래스
EnemyBase : EnemyManager의 객체 등록, 등록 해제 호출, 객체의 상태, 정보 저장
버그 해결 💊
발견된 버그
WeaponBase가 같은 객체의 컴포넌트인 AttackData에서 정의된 데이터를 생성하는 ProjectileBase에 전달하려고 했으나 ProjectileBase의 AttackData 값이 변경되지 않는 버그를 확인한 상태, 이걸 해결해야 리팩토링된 형식에 맞춰서 새로 무기 업그레이드 구현이 가능함
테스트 💻
hp
-void InitDebugText()를 이용하여 체력 표기, 정상 작동 확인
비고 ✏
이전에 pr 잘못한 4주차 작업 내용 포함입니다.
늘어난 스크립트들 보면서 그냥 잘 돌아가는거 놔둘걸 왜 괜히 리팩토링하려 했는지 후회 중입니다.