-
[unity - c#] : MonoBehaviour은 왜 있는 거지?unity 2022. 4. 17. 15:48
MonoBehaviour은
유니티에서 생성하는 모든 스크립트가 상속받는 기본 클래스.
c#에서 코드를 작성하기 위해 파일을 생성하면 아래와 같이 나온다.
public class TB : MonoBehaviour { // Start is called before the first frame update void Start() { }
여기서 : MonoBehaviour은 TB안에 코드들을 원활하게 작동 시킬 수 있도록한다.
start(), update(), 등... 많은 매서드가 여기에 상속되어 있다.
즉, : MonoBehaviour이게 빠지면 상속되어 있는 매서드를 못 쓴다는 뜻이다.
'unity' 카테고리의 다른 글
[Unity - c#]Vector3.Magnitude 활용하여 거리 구하기 (0) 2022.07.11 [unity] - [System.Serializable]은? (0) 2022.04.17 [Unity(c#) - instance] 단순하게 생각하기 (0) 2022.04.08 [unity - mathf] clamp에 관하여 (요약) (0) 2022.04.01 [unity - particle system] renderer cube가 제대로 안될 때 (0) 2022.03.30