Unity Study

01. 유니티 2D 새 프로젝트 만들기

정보은행 2023. 1. 8. 14:09
반응형
SMALL

유니티 설치 과정은 생략하고, 새 프로젝트 만드는 과정부터부터 설명하도록 하겠습니다. 각종 유니티 뷰 화면에 대한 설명에 대해서 작성해보도록 하겠습니다.

 

유니티 2D 새 프로젝트 만들기

유니티 2D 새프로젝트 생성
유니티 2D 새 프로젝트 생성

 위의 사진을 보면 2D(URP)코어를 선택하고 프로젝트 생성을 누르시면 됩니다. 

 2D(URP)코어와 2D코어의 차이가 무엇일까?

 그 차이는 유니티 게임엔진에서 렌더링 쪽 그리는 방법을 바꾸었다는 겁니다. 예를 들어, 빛과 그림자의 효과를 사용하여 좀 더 고퀄리티의 2D 게임을 만들 수 있다고만 인식하시고, 프로젝트를 생성하시면 됩니다.

 추후에 이 차이점에 대해서 좀 더 심층적으로 작성하도록 하겠습니다.

 

  프로젝트 이름도 변경해봅시다. SideScrollingGame로 프로젝트 이름을 바꾸고 생성하도록 하겠습니다. 프로젝트가 만들어지는 위치 경로 지정은 프로젝트 이름 바로 아래에 있으니 원하시는 곳에 넣으시면 됩니다. 

 다만, 여기서 중요점은 무조건 영어경로로 만드세요. 유니티 게임엔진이 해외 회사라서 자잘한 버그나 에러 오류가 발생하는 문제점이 생길지 모르니까요. 프로젝트 명도 영어로 만들어줍니다.

 

 실행하고 나면 로딩 시간이 좀 걸립니다. 밑의 화면이 뜨고 로딩 시간을 기다려줍시다.

유니티 프로젝트 생성 로딩화면
유니티 프로젝트 생성 로딩화면

 

 프로젝트가 생성이 되었다면 유니티 허브 리스트에 올라가게 됩니다. 

 자신이 만든 프로젝트가 여러개 있다면 여러 개가 뜰 것입니다. 

유니티허브 프로젝트 선택
유니티 허브 프로젝트 선택


 새 프로젝트 로딩이 완료가 되면 다음과 같은 화면이 나오는데 혹시나 유니티 ID가 로그인이 안되어 있다면 콘솔창에 다음과 같은 에러가 발생할 수도 있습니다. 해결 방안을 알려드리겠습니다.

[Package Manager Window] Error searching for packages.
Unable to perform online search:
  Cannot fetch authorization code. User access token is expired or invalid. You may need to sign out and sign in again.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

유니티허브 로그인
유니티허브 로그인
유니티 로그인
유니티 로그인
Unity 로그인 성공
Unity 로그인 성공
유니티 엔진 화면 구성
유니티 엔진 화면 구성

 각 영역의 이름과 역할을 무조건 기억합시다. 유니티 엔진으로 게임을 만들면 각 영역의 뷰를 자주 오가면서 개발을 진행해야 합니다. 그럼 각 뷰의 특징을 알아야 하지 않겠는가?

 그리고, 유니티는 1초에 50번을 그리는 것을 표준으로 하고 있다고 합니다. 만약 60FPS라면 1초에 60번 그린다는 의미입니다. 

 

  • 씬 뷰 : 씬 뷰와 게임 뷰를 보통 같이 보게 되는데 게임 뷰게임실행화면이고, 씬 뷰게임편집화면 입니다. 
  • 하이어라키 뷰 : 씬 뷰에 캐릭터, 배경 등을 넣으면 계단식으로 계층적으로 목록을 표시해주는 화면입니다. 즉, 하이어라키 뷰게임오브젝트 계층별 목록 화면입니다.  
  • 인스펙터 뷰 : 씬 뷰나 하이어라키 뷰에서 선택된 게임오브젝트의 정보를 보여주는 화면입니다. 
  • 프로젝트 뷰 : 게임에 사용되는 에셋을 보여주는 화면입니다. 말인즉슨, 이미지, 오디오, 소스코드 등을 보여주는 화면입니다. 

스마트폰 게임 화면 설정하기

스마트폰에 맞춰서 게임화면 설정하는 방법입니다. 

가로 설정은 16:9 Type은 Aspect Ratio로 설정하면 됩니다.

유니티 화면 가로 설정
유니티 화면 가로 설정
모바일 가로 설정
모바일 가로 설정

 

세로 설정은 9:16 Type은 Aspect Ratio로 설정하면 됩니다.

유니티 세로 설정
유니티 화면 세로 설정

 

 이외에도 레이아웃(Layout)을 설정을 하여 자신만의 화면구성을 만들 수도 있습니다. 유니티 2D 게임제작 전에 가장 먼저 화면 구성과 간단한 위치 조정을 먼저 해보면서 자유롭게 건드릴 정도로 만져봐야 합니다. 익숙지 않으면 운전도 못합니다. 아무리 베테랑에게 운전을 배우면 무엇하겠는가? 정작 운전하는 사람이 연습을 한 번도 하지 않으면 이론만 아는 사람이 되는 것입니다.

 익숙해지도록 익히고 또 익힙시다.


01. Create a new Unity 2D project

 

I will skip the Unity installation process and start with the process of creating a new project. I will write about the description of various Unity view screens.

  Looking at the picture above, select 2D (URP) Core and click Create Project.

  What is the difference between 2D (URP) core and 2D core?

  The difference is that the Unity game engine has changed the way it draws on the rendering side. For example, you only need to recognize that you can create a higher-quality 2D game using light and shadow effects, and create a project.

  We will write more about these differences later.

   Let's change the project name as well. Let's rename the project to SideScrollingGame and create it. The location path where the project is created is right below the project name, so you can put it anywhere you want.

  However, the important point here is to make it an English route unconditionally. Since the Unity game engine is an overseas company, there may be problems with minor bugs or errors. The project name is also made in English.

  After running it will take some time to load. The screen below will appear and wait for the loading time.

  If the project is created, it will be listed on the Unity Hub list.

  If you have multiple projects you have created, multiple will appear.

  When the loading of the new project is complete, the following screen appears. If your Unity ID is not logged in, the following error may occur in the console window. We will tell you the solution.

[Package Manager Window] Error searching for packages.
Unable to perform online search:
   Cannot fetch authorization code. User access token is expired or invalid. You may need to sign out and sign in again.
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

  Let's unconditionally remember the name and role of each area. If you make a game with the Unity engine, you have to go back and forth between the views of each area frequently while developing. So, shouldn't we know the characteristics of each view?

  Also, it seems that Unity makes it standard to draw 50 times per second. If it's 60FPS, that means drawing 60 times a second.

Scene view: You usually see the scene view and the game view together. The game view is the game execution screen, and the scene view is the game editing screen.
Hierarchy View: This is a screen that displays a list hierarchically in a cascading fashion when characters and backgrounds are entered in the scene view. In other words, the Hierarchy View is a list screen for each GameObject hierarchy.
Inspector View: This screen shows the information of the GameObject selected in the Scene View or Hierarchy View.
Project View: This screen shows the assets used in the game. In other words, it is a screen that shows images, audio, source code, etc.

Setting up the smartphone game screen
This is how to set the game screen according to the smartphone.

As for the horizontal setting, 16:9 Type can be set to Aspect Ratio.

For vertical setting, 9:16 Type can be set to Aspect Ratio.

unity portrait setup
unity screen height setting


  In addition, you can create your own screen composition by setting the layout. Before creating a Unity 2D game, you must first try the screen configuration and simple position adjustment, and touch it freely enough to touch it. You can't even drive if you're not used to it. What would you do if you learned to drive from a veteran? If a person who drives a car never practices, he becomes a person who only knows the theory.

  Let's get used to it and learn it again and again. 

반응형
LIST