공부/사용한 코드 (2) 썸네일형 리스트형 Unity_Movent(Rigidbody) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { public float Force; // public의 특징으로는 inspector창에 해당 값에 대한 박스가 생성되어 값의 제어가 가능하다(빠른 값조절이 장점임), 반대로 private일 경우 inspector창에 해당 값에 대한 박스가 생성되지 않는다. Rigidbody rb; // Start is called before the first frame update void Start() { rb = GetComponent(); // generic에의해서 GetComponent로 모든 comp.. Unity_Movement(Translate) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { public float speed; // Update is called once per frame void Update() // 60 ~ 120fps { // Transform은 type, transform은 자신의 Object transform component로 바로 접근하는 객체이기 때문에 GetComponent(); 할필요 없이 transform으로 접근하면 된다. // Transform은 GameObject의 position, rotation, scale을 담당하는 component이다.. 이전 1 다음