본문 바로가기

Unity/Unity Learn

Unity Essentials > Essentials of real-time 3D

https://learn.unity.com/project/essentials-of-real-time-3d?uv=2020.3&pathwayId=5f7bcab4edbc2a0023e9c38f&missionId=5f777d9bedbc2a001f6f5ec7

 

Essentials of real-time 3D - Unity Learn

In this learning project, you will be introduced to some of the essential tasks of an artist, game developer, or other creator of interactive 3D experiences. You’ll explore the 3D capabilities and features of Unity, starting with creating and manipulatin

learn.unity.com

 

 

◈ Work with GameObjects in a 3D scene

4. Work with GameObjects in the Inspector

Note: 

Unity uses a Y-up coordinate system. 

This means that in the Editor screen space, 

the y-axis is vertical 

and the x- and z-axes represent the horizontal plane 

(similar to north, south, east, and west). 

 

Some 3D applications, such as 3ds Max, use the z-axis as the vertical.



유니티는 왼손 좌표계

엄지 손가락이 X축, 검지 손가락이 Y축, 중지 손가락이 Z축

왼손 좌표계와 오른손 좌표계의 차이는 Z축이 가리키는 방향이 달라진다.

 

※ 참고 : 

DirectX는 유니티와 동일한 왼손 좌표계 Y-up 방식이다.

언리얼 엔진도 왼손 좌표계이지만 Z-up 방식이다.

 

 

 

 

 

 

 Add physical properties to 3D GameObjects

2. Get started with materials

Materials물체의 표면 특성을 정의하는 구성요소.

 

간단한 materials를 만들어 게임 오브젝트의 시각적 모양을 변경할 수 있다. 

 

다른 GameObjects에 다른 materials을 적용하여 오브젝트가 보이는 방식을 관리할 수도 있습니다.

 

다양한 유형의 asset들을 별도의 폴더에 구성하는 것이 일반적이다.

 

 

3. Create a material with a solid color

Albedo 속성 : material의 기본 색상을 지정

참고 : GameObject를 다시 흰색으로 변경하려면 Default-Material이라는 material을 적용.

 

 

4. Create a material with a texture map

Inspector 창에서 Albedo 속성 옆에 있는 object selector(원 아이콘)를 선택하고 가져온 Herringbone 텍스처 파일을 선택.

 

 

텍스처의 크기를 변경하려면 material를 선택하고 Inspector에서 Tiling X 및 Y 속성을 변경한다. 

숫자가 작을수록 벽돌이 커 보인다.

 

※ 참고 :

변경하는 Tiling X 및 Y 속성이 Inspector에 있는 material 속성의 Main Maps 섹션에 있어야 하며 Secondary Maps 섹션이 아니다.

 

 

5. Add a Physic material

Physic materials이라는 다른 유형의 materials을 사용하여 물리적 특성을 추가.

 

Physic materials는 물체를 튕기게 하고 마찰 및 끌기 속성을 변경 하는 다른 유형의 materials.

 

이러한 속성은 물체가 중력의 영향을 받을 때 적용.

 

Physic materials는 GameObjects의 시각적 속성을 변경하지 않는다.

 

Create > Physic Material 메뉴를 통해 생성하고 Bounciness 값 변경

 

 

 

 

 

 

 Manage GameObjects with prefabs

1. Overview

생성하는 Unity 프로젝트에는 일반적으로 관리할 GameObjects가 많다.

많은 경우 GameObjects는 다른 것들의 복사본이다.

 

게임 오브젝트를 디자인할 때 한 항목의 모든 복사본을 변경하고 싶을 때 많은 복사본을 관리하는 대신 prefab을 사용하여 복제된 GameObjects를 구성할 수 있다.

 

prefab은 GameObjects의 템플릿 역할을 하는 asset이다.

prefab에서 instances라고 하는 여러 복사본을 만들 수 있다.

prefab asset을 변경하면 해당 인스턴스도 모두 변경된다.

 

 

4. Update prefab instances in prefab mode

In the Hierarchy, select a prefab instance and then select the arrow on the right side of the row.

Tip: 단독으로 prefab을 편집하려면 Alt 키를 누른 상태에서 화살표를 선택해야 한다. 

 

 

5. Override prefab properties

Inspector 상단에 있는 Prefab 컨트롤을 사용하여 Overrides를 선택하여 프리팹과 다른 구성 요소 목록을 확인

 

 

Sphere Collider를 원래 설정으로 되돌리려면 component의 Overrides 버전 상단에서 Revert를 선택

 

base prefab에 Transform component의 Overrides를 적용하려면 Overrides dropdown으로 돌아가서 Transform > Apply > Apply to Prefab “BouncyBall”에 적용을 선택. 

 

Overrides는 prefab을 한 번에 하나씩 변경하거나, 

여러 GameObject에 적용하기 전에 변경 사항을 테스트하려는 경우에 유용하다.

 

 

 

 

 

 

 Publish your project

1. Overview

이 튜토리얼에서는 웹에서 프로젝트를 Unity Essentials 커뮤니티 및 동료 제작자와 공유할 수 있도록 WebGL 빌드를 만들고 게시한다.

WebGL 빌드를 Unity Play에 게시하거나 다른 호스팅 플랫폼을 사용할 수 있다.

 

 

Create and publish WebGL builds

Create a WebGL build

 

File > Build Settings

shortcut : Ctrl + Shift + B (Windows)

 

WebGL 빌드는 index.html 파일 과 게임을 실행하는 데 필요한 폴더, 파일 및 asset으로 구성된다.

index.html 파일은 게임의 런처 역할을 한다.