Unity/Script (1) 썸네일형 리스트형 This Unity에서 this는 해당 Script Component를 가리키는 변수입니다. 예를 들어 Sample Class라는 임의의 MonoBehaviour를 상속받는 class를 만들고, 그 class 내에서 this를 호출한다면 이는 GameObject에 소속된 Sample Class Component를 가리키게 되는 것입니다. 그렇기 때문에 Destroy(this)와 Destroy(gameObject)의 차이점은, 전자는 gameObject에 소속된 Component를 지우는 것이고 후자는 gameObject 그 자체를 지운다는 것입니다. 자료 출처 https://docs.unity3d.com/kr/2020.3/Manual/class-GameObject.html 이전 1 다음