일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- Unity
- 오브젝트 풀링
- 2D슈팅게임
- pccp 기출문제 3번
- Algorithm
- Back Tracking
- ASTAR
- pccp 기출문제 2번
- Object Poling
- Object Pooling
- Scrooling
- 깊이 우선 탐색
- 프로그래머스
- Ainimation Blending
- Animation State Machine
- 너비 우선 탐색
- Blend Type
- heap tree
- LayerMark
- 플레이어 이동
- Lv2
- Hpbar
- Hp바
- C#
- 충돌위험 찾기
- 유니티
- CSharp #자료구조
- raycasting
- 플레이어 방향전환
- pccp 기출문제 1번
- Today
- Total
주녘공부일지
[ShootingGame] 10. 따라다니는 보조무기 만들기 본문
0. 준비하기
- Follower 오브젝트 3개 추가, FollowerBullet 프리펩 추가
- 보조 총알도 오브젝트 풀링 등록 ( class ObjectManager에 추가 )
1. 기본 작동 구현
- class Player에서 필요한 변수와 함수를 가져와서 수정해서 사용
2. 팔로우 로직 ( 상속시키듯 구현 )
Watch(), Follow() : 따라갈 위치를 갱신해주는 함수 // Update()문에서 실행
- Follower(0) 는 Player를 parent로 갖고, Follower(1)는 Follower(0)를, Follower(2)는 Follower(1)을 parent로 가져서 따라가게 만듬
#. Input Pos - 부모 오브젝트의 위치변동이 없다면, 자식도 이동하지 않음 (저장하지 않음)
#. Output Pos - 위치 정보를 프레임 단위로 큐에 저장하는데, 채워지기 전까지는 부모의 위치로 적용시키고, 데이터가 모두 채워지면 따라감 (채워진 갯수 == followDelay 값)
+ 팔로우딜레이 변수의 크기만큼 프레임 단위로 저장하기 때문에, 팔로우딜레이 변수의 크기가 클수록 따라가는 거리가 가 증가함 ( Update()문 - 프레임 단위로 실행 )
Queue - FIFO (First Input First Out) // 선입선출 자료구조
- Contains() : 큐에 요소가 있는지 여부를 확인하는 함수 ( 존재 시, true )
- Enqueue() : 큐에 데이터를 저장하는 함수
- Dequeue() : 큐의 첫 데이터를 빼면서 반환해주는 함수
https://godgjwnsgur7.tistory.com/24
3. 파워 적용
- 파워 4,5,6 로직 추가, maxPower = 6으로 변경, 등
+ Fire() 함수의 case 3: - default: 로 변경
https://github.com/godgjwnsgur7/ShootingGame
강의 출처
https://www.youtube.com/watch?v=QPwF2Lsf7c8&list=PLO-mt5Iu5TeYtWvM9eN-xnwRbyUAMWd3b&index=10
'GameDevelopment > [Unity] Lecture' 카테고리의 다른 글
[ShootingGame] 12. 마무리 구현 // 강의 내용 마무리 (0) | 2022.02.09 |
---|---|
[ShootingGame] 11. 탄막을 뿜어대는 보스 만들기 (0) | 2022.02.07 |
[ShootingGame] 9. 텍스트파일을 이용한 커스텀 배치 구현 ( + 구조체 ) (0) | 2022.02.02 |
[ShootingGame] 8. 최적화의 기본, 오브젝트 풀링 (0) | 2022.02.01 |
[ShootingGame] 7. 원근감있는 무한 배경 만들기 + 페럴렉스, 스크롤링 (0) | 2022.01.31 |