일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Programming
- DP
- Material
- 시작해요 언리얼 2022
- dfs
- python
- 재귀
- String
- Tutorial
- Class
- 오류
- Algorithm
- dynamic
- Unreal Engine 5
- Unity
- github
- loop
- parameter
- 문제풀이
- Basic
- c++
- UE5
- 파이썬
- 기초
- guide
- w3school
- 프로그래밍
- W3Schools
- C#
- 백준
- Today
- Total
행복한 개구리
Unity 21.04.05.수업내용 본문
수업 전 유니티 설정
Scene 안에 있는 object들은 전부 GameObject라고 칭함 안에 있는 object들은 전부 GameObject라고 칭함
동시에 Hierachy에 표시된다
Project창에 있는 모든 것은 파일이다
게임오브젝트는 컴포넌트로 이루어져있다
Components들은 탈부착가능. 단, Transform제외.
GameView는 카메라영역에 있는 게임오브젝트들이 매 프레임마다 연산되어 화면 출력된 결과이다.
1.플랫폼설정
2.게임뷰 해상도 설정
3.카메라 설정
clear flags : solid color, background : 어둡게
ㄴ2D = 직교설정, size설정
ㄴ3D = x
4. SceneView에서 toggle skybox
스크립트는 게임에서 오브젝트를 움직이게하는 대본이다. 스크립트를 다 작성하면 오브젝트에 적용해(드래그해서 넣기, 완료되면 스크립트는 게임오브젝트의 컴포넌트가 됨.) 스크립트에 작성된 대로 오브젝트가 움직이도록 만든다.
유니티 중요사항
ㄴmonobehavior을 상속해서 유니티lifecycle에 있는 기능들을 작동할 수 있다.(?)
ㄴmonobehavior을 상속받아야만 컴포넌트로서 작동할 수 있다.
ㄴnew라는 키워드를 통해서 객체를 생성할 수 없다.
Unity - Manual: Order of execution for event functions (unity3d.com)
Unity - Manual: Order of execution for event functions
Instantiating Prefabs at run time Order of execution for event functions Running a Unity script executes a number of event functions in a predetermined order. This page describes those event functions and explains how they fit into the execution sequence.
docs.unity3d.com
ㄴ자주 보게될 것
============================================================================
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RouletteController : MonoBehaviour
{
public float factor;
float rotSpeed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
//클릭한다면
//회전속도만큼 룰렛을 회전
if (Input.GetMouseButtonDown(0))
{
this.rotSpeed = 10f;
Debug.Log("Down");
}
else if (Input.GetMouseButtonUp(0))
{
Debug.Log("Up");
}
else
{
Debug.Log("Press");
}
transform.Rotate(0, 0, this.rotSpeed);
this.rotSpeed *= factor;
Debug.Log(this.rotSpeed);
if (this.rotSpeed < 0.002f)
{
this.rotSpeed = 0;
}
}
}
'Unity > 수업내용' 카테고리의 다른 글
Unity 21.04.14.수업내용 (0) | 2021.04.14 |
---|---|
Unity 21.04.09.수업내용 (0) | 2021.04.09 |
Unity 21.04.08.수업내용 (0) | 2021.04.08 |
Unity 21.04.07.수업내용 (0) | 2021.04.07 |
Unity 21.04.06.수업내용 (0) | 2021.04.06 |