GetComponent

Untitled

if, GetKeyDown, GetKey, Instantiate

GetKey로 좌,우 이동과 점프를 하는 코드

Instantiate를 이용하여 총알을 복사하여 쏘는 코드

Untitled

Vector, AddForce, onTrigger

AddForce를 점프하는데 이용하였다.

ontrigger를 통해 더블점프를 막는 코드

Untitled

text, SceneManagement, gameObject

Scenemanagemnet로 hp가 0이 되면 씬을 바꾸는 코드

GameObject.name으로 입력된 targetObjectName의 이름을 가진 물체와 닿으면 체력이 줄게되는

코드

Untitled

trasform

Random.range로 x축의 -11부터 11까지 랜덤한 위치에 transform으로 변해가며 떨어지는 코드