- 스크립트 개념
- Start()
- Update()
- 이벤트 함수들의 실행 순서
- Quiz. Class vs Instance
- public인 변수들
- Debug.Log()
- 입력 처리
- Input.GetKey(키코드)
- Key, KeyDown, KeyUp
- Input.GetMouseButton(0) // 0: 좌클릭, 1: 우클릭, 2: 중간(휠) 클릭
- 입력 받아서 플레이어 움직이기
- Vector3
- 내적(dot)/외적(cross)
- 사칙연산
- struct 주의점
- Quiz. struct vs class, 복사할 때 value type과 reference type의 동작 방식
- `transform.position.x = 2.3f;`가 사실은 `transform.GetPosition().x = 2.3f;`였다! 그래서 미리 컴파일러가 막아준다
- Translate - self vs global
- 처음보는 함수 ➡ [유니티 매뉴얼](https://docs.unity3d.com/kr/current/Manual/index.html)
- Frame과 deltaTime
- Framerate Independent하게 만들자!
- `Update() { "오른쪽으로 한칸 움직여라" }`는 컴퓨터 성능과 비례한다
- 모든 물체를 시간과 비례하도록 움직이게 해야한다
- 물체의 이동과 회전
- 에셋스토어
> 숙제: Flappy Bird의 새의 점프 구현하기
- 계속 점프가 가능해야 함
- 컴퓨터 성능과 무관해야 함
- `transform.position`만 이용해서 점프 구현
#### Flappy Bird Jump 예시: CustomJump.cs
결과: [https://iamgroooooot.github.io/cien-unity-2020/jump-using-position/](https://iamgroooooot.github.io/cien-unity-2020/jump-using-position/)
15. 대부분의 (물리) 값들은 Vector3로 표현되어 있다
(ex) 위치, 회전, 크기
Vector3? x, y, z 값을 가진 구조체(struct)
• x, y, z는 float형임을 주의하자!
• Struct(구조체)이다!
Quiz. Class와 Struct의 차이점?
• 벡터 연산 가능하다!
외적/내적
벡터 사칙연산
(ex)