{"id":79,"date":"2016-02-06T13:48:52","date_gmt":"2016-02-06T04:48:52","guid":{"rendered":"http:\/\/milennium9.godohosting.com\/wordpress\/?p=79"},"modified":"2016-02-15T11:33:57","modified_gmt":"2016-02-15T02:33:57","slug":"unity3d-destroy-%ed%95%a8%ec%88%98%ec%99%80-ondestroy","status":"publish","type":"post","link":"http:\/\/milennium9.godohosting.com\/wordpress\/?p=79","title":{"rendered":"[Unity3D] Destroy \ud568\uc218\uc640 OnDestroy"},"content":{"rendered":"<p>\ub85c\uc9c1\uc744 \ub9cc\ub4e4\ub2e4\ubcf4\ub2c8 \ud2b9\uc815 \uc870\uac74\uc77c \ub54c Start() \ud568\uc218\uc5d0\uc11c Destroy\ub97c \ud638\ucd9c\ud560 \uc77c\uc774 \uc0dd\uacbc\uc2b5\ub2c8\ub2e4. \uadf8\ub7f0\ub370 \ubb38\ub4dd OnDestroy\ub294 \uc5b4\ub290 \ud0c0\uc774\ubc0d\uc5d0 \ud638\ucd9c\ub418\ub294 \uac83\uc778\uc9c0 \uc815\ud655\ud788 \uc54c\uace0 \uc2f6\uc5b4\uc84c\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub798\uc11c \uc544\ub798\uc640 \uac19\uc740 \ucf54\ub4dc\ub85c \ud14c\uc2a4\ud2b8\ub97c \ud574\ubd24\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:c# decode:true \">using UnityEngine;\r\nusing System.Collections;\r\n\r\npublic class Test : MonoBehaviour {\r\n    \/\/ Use this for initialization\r\n    void Start () {\r\n        Destroy(gameObject);\r\n        Debug.Log(\"Test Start\");\r\n    }\r\n\r\n    void OnDestroy() {\r\n        Debug.Log(\"Test Destroy\");\r\n    }\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Destroy \ud568\uc218\ub97c \ud638\ucd9c\ud558\uc5ec Object\ub97c \uc81c\uac70\ud558\uba74 \uc989\uc2dc \uc81c\uac70\ub418\ub294 \uac83\uc774 \uc544\ub2c8\ub77c \ud574\ub2f9 Frame\uc758 \ub9c8\uc9c0\ub9c9\uc5d0 \uc81c\uac70\ub429\ub2c8\ub2e4. \uc774\ub7f0\uc2dd\uc73c\ub85c \ub3d9\uc791\ud558\ub294 \uac83\uc740 \ubcf5\uc7a1\ud55c \ub85c\uc9c1 \ucc98\ub9ac \uc911 \uc624\ube0c\uc81d\ud2b8\uac00 \uc81c\uac70\ub418\uc5b4 null \ucc38\uc870\uac00 \uc77c\uc5b4\ub098\ub294 \uc77c\uc744 \uc904\uc5ec\uc90d\ub2c8\ub2e4. Destroy \ud638\ucd9c\ud558\uace0\ub098\uc11c \ud574\ub2f9 \uac1d\uccb4\ub97c \ucc38\uc870\ud558\ub294\uac8c \uc798\ubabb\ub41c\uac8c \uc544\ub2c8\ub0d0\uace0 \ubcfc \uc218\ub3c4 \uc788\uc73c\ub098 Coroutine\uc774\ub098 Animator\ub4f1 \ubcf5\uc7a1\ud558\uac8c \uc5f0\uacc4\ub41c \ub85c\uc9c1\uc5d0\uc11c\ub294 null\ucc38\uc870\ub97c \uc5c6\uc560\ub294\uac8c \ub354 \ud798\ub4e7\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub7ec\uba74 OnDestroy\ub294 Destroy \ud568\uc218\ub97c \ud638\ucd9c\ud588\uc744 \ub54c \ud638\ucd9c\ub420\uc9c0 \uc544\ub2c8\uba74 \uc2e4\uc81c\ub85c \uc18c\uba78\uc774 \uc77c\uc5b4\ub098\ub294 \ud0c0\uc774\ubc0d\uc5d0 \ud638\ucd9c\ub420\uc9c0 \ud14c\uc2a4\ud2b8\ub97c \ud574\ubcf4\uae30 \uc704\ud574\uc11c \uc704\uc640\uac19\uc740 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud574 \ubcf4\ub2c8 \ucf58\uc194\ucc3d\uc5d0 \uc544\ub798\uc640 \uac19\uc774 \ucd9c\ub825\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n<p>Test Start<br \/>\nTest Destroy<\/p>\n<p>OnDestroy\ub294 \uc2e4\uc81c\ub85c \uc18c\uba78\uc774 \uc77c\uc5b4\ub098\ub294 \ud0c0\uc774\ubc0d\uc5d0 \uac1d\uccb4\ub97c \uc18c\uba78\uc2dc\ud0a4\uae30 \uc9c1\uc804\uc5d0 \ud638\ucd9c\ud558\ub294 \ubaa8\uc591\uc785\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ub85c\uc9c1\uc744 \ub9cc\ub4e4\ub2e4\ubcf4\ub2c8 \ud2b9\uc815 \uc870\uac74\uc77c \ub54c Start() \ud568\uc218\uc5d0\uc11c Destroy\ub97c \ud638\ucd9c\ud560 \uc77c\uc774 \uc0dd\uacbc\uc2b5\ub2c8\ub2e4. \uadf8\ub7f0\ub370 \ubb38\ub4dd OnDestroy\ub294 \uc5b4\ub290 \ud0c0\uc774\ubc0d\uc5d0 \ud638\ucd9c\ub418\ub294 \uac83\uc778\uc9c0 \uc815\ud655\ud788 \uc54c\uace0 \uc2f6\uc5b4\uc84c\uc2b5\ub2c8\ub2e4. \uadf8\ub798\uc11c \uc544\ub798\uc640 \uac19\uc740 \ucf54\ub4dc\ub85c \ud14c\uc2a4\ud2b8\ub97c \ud574\ubd24\uc2b5\ub2c8\ub2e4. using UnityEngine; using System.Collections; public class Test : MonoBehaviour { \/\/ Use this for initialization void Start () { Destroy(gameObject); Debug.Log(&#8220;Test Start&#8221;); } void OnDestroy() { Debug.Log(&#8220;Test Destroy&#8221;); &hellip; <a href=\"http:\/\/milennium9.godohosting.com\/wordpress\/?p=79\" class=\"more-link\"><span class=\"screen-reader-text\">[Unity3D] Destroy \ud568\uc218\uc640 OnDestroy<\/span> \ub354\ubcf4\uae30 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5PypW-1h","_links":{"self":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/79"}],"collection":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79"}],"version-history":[{"count":1,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":81,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/79\/revisions\/81"}],"wp:attachment":[{"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/milennium9.godohosting.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}