일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 쿠킹덤
- 크리스마스
- Unity
- dart
- Java
- 쿠키런킹덤공략
- 딥러닝
- 자바스크립트
- programmers
- Eclipse
- 홀리데이익스프레스
- 이클립스
- edwith
- 자바
- 쿠키런킹덤크리스마스
- 노마드코더
- 개발자
- 쿠킹덤공략
- SQL
- 프로그래머스
- oracle
- HTML
- MySQL
- 유니티
- 오블완
- 티스토리챌린지
- Spring
- 웹개발
- JavaScript
- 쿠키런킹덤
Archives
- Today
- Total
Dev study and notes
유니티6 챌린지 게임만들기07- Unity 6 장애물 1 Obstacles pt.1 본문
Building & Learning/Unity 6 Challenge
유니티6 챌린지 게임만들기07- Unity 6 장애물 1 Obstacles pt.1
devlunch4 2025. 1. 22. 23:37반응형
유니티6 챌린지 게임만들기07- Unity 6 장애물 1 Obstacles pt.1 - Unity 6 Challenge Start
이번 글에는 영상속 유니티 안내에 따라 빌딩과 아이템들을 배치하게 됩니다.
먼저 건물 배치를 해봅니다.


건물 이미지 객체의 픽셀 크기 값과 위치 설정, sprite mode를 싱글로 설정합니다.
유니티 에디터의 빌딩 객체에 컴포넌트를 추가하기위해 mover, destoryer을 파일명으로 move behaavior를 생성합니다.

스트립트를 생성하고 소스 작성을 통해 건물 객체를 어느위치에서 나타나고, 이동하고, 사라지게 해야하는지 설정합니다.
설정 값을 가지고 동일한 객체이지만 이미지가 다른 것으로 5개를 생성합니다.



건물을 생성하고, 이어서 빈객체를 생성 및 생성된 빈 객체에 Spawner 컴포넌트를 추가합니다.
추가된 spawner 게임 오브젝트 객체에 5개의 건물이미지를 요소로 넣습니다.
객체의 포지션, 첫 위치 지정을 위해 이미지 객체의 transform의 위치 값을 모두 0으로 설정합니다.


건물들이 생성되고 시간에 맞춰 다른 건물이 랜덤으로 생성되도록 소스를 작성합니다.
여기 까지 작성한 코드와 유니티 에디터를 플레이해보았습니다.
건물이 시간에 따라 랜덤으로 생성됩니다.
이어서 다음글에 추가 장애물을 넣어보는 것을 영상보며 진행해보겠습니다.

끝!
반응형
'Building & Learning > Unity 6 Challenge' 카테고리의 다른 글
유니티6 챌린지 게임만들기09- Unity 6 플레이어 P타격 및 치유 Player Hit and Hea (0) | 2025.01.22 |
---|---|
유니티6 챌린지 게임만들기08- Unity 6 장애물 2 Obstacles pt.2 (1) | 2025.01.22 |
유니티6 챌린지 게임만들기06- Unity 6 애니메이션 Animation (0) | 2025.01.22 |
유니티6 챌린지 게임만들기05- Unity 6 플레이어 점프 Player Jump (0) | 2025.01.22 |
유니티6 챌린지 게임만들기04- Unity 6 스크롤링 스크립트 Scrolling Script (0) | 2025.01.22 |
Comments