{"id":2083,"date":"2026-08-07T15:11:13","date_gmt":"2026-08-07T15:11:13","guid":{"rendered":"https:\/\/wayhope.kro.kr\/?p=2083"},"modified":"2026-08-31T07:32:57","modified_gmt":"2026-08-31T07:32:57","slug":"unity-coroutine","status":"publish","type":"post","link":"https:\/\/wayhope.kro.kr\/?p=2083","title":{"rendered":"Unity Coroutine"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Unity\uc5d0\uc11c \ud2b9\uc815 \uc791\uc5c5\uc744 \uc77c\uc815 \uc2dc\uac04 \ub4a4\uc5d0 \uc2e4\ud589\ud558\uac70\ub098 \uc5ec\ub7ec \ud504\ub808\uc784\uc5d0 \uac78\uccd0 \uc21c\ucc28\uc801\uc73c\ub85c \ucc98\ub9ac\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \uc788\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub300\ud45c\uc801\uc778 \ubc29\ubc95\uc774 <code>Update()<\/code>\uc5d0\uc11c \uc2dc\uac04\uc744 \uc9c1\uc811 \uacc4\uc0b0\ud558\ub294 \uac83\uc774\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private float timer;\n\nprivate void Update()\n{\n    timer += Time.deltaTime;\n\n    if (timer &gt;= 5f)\n    {\n        timer = 0f;\n        ActivateSkill();\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ub3d9\uc791 \uc790\uccb4\ub294 \ubb38\uc81c\uac00 \uc5c6\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud558\uc9c0\ub9cc \ub2e8\uc21c\ud788 &#8220;5\ucd08 \uae30\ub2e4\ub9b0 \ub4a4 \uc2e4\ud589\ud55c\ub2e4&#8221;\ub77c\ub294 \ub85c\uc9c1\uc744 \ud45c\ud604\ud558\uae30\uc5d0\ub294 \ucf54\ub4dc\uac00 \ubd88\ud544\uc694\ud558\uac8c \ubcf5\uc7a1\ud574\uc9c4\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f4 \ub54c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 Coroutine\uc774\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine -&gt; \uc2e4\ud589 -&gt; yield -&gt; \uc77c\uc2dc \uc815\uc9c0 -&gt; \uc870\uac74 \ucda9\uc871 -&gt; \uc7ac\uac1c -&gt; \uc885\ub8cc\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine\uc774\ub780<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \uc77c\ubc18\uc801\uc778 \ud568\uc218\ucc98\ub7fc \ud55c \ubc88 \ud638\ucd9c\ud574\uc11c \ub05d\uae4c\uc9c0 \uc2e4\ud589\ud558\ub294 \ubc29\uc2dd\uacfc \ub2e4\ub974\uac8c, \uc2e4\ud589\uc744 \uc911\uac04\uc5d0 \uc911\ub2e8\ud588\ub2e4\uac00 \ub098\uc911\uc5d0 \uc911\ub2e8\ub41c \uc9c0\uc810\ubd80\ud130 \ub2e4\uc2dc \uc2e4\ud589\ud560 \uc218 \uc788\ub294 \uad6c\uc870\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc77c\ubc18\uc801\uc778 \ud568\uc218\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\ud568\uc218 \ud638\ucd9c -&gt; \ucc98\uc74c\ubd80\ud130 \uc2e4\ud589 -&gt; return -&gt; \uc885\ub8cc\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \ub2e4\uc74c\uacfc \uac19\uc774 \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine \ud638\ucd9c -&gt; \uc2e4\ud589 -&gt; yield -&gt; \uc77c\uc2dc \uc815\uc9c0 -&gt; \uc7ac\uac1c -&gt; \uc2e4\ud589 -&gt; yield -&gt; ... -&gt; \uc885\ub8cc\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ud575\uc2ec\uc740 <code>yield<\/code>\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>yield<\/code>\ub97c \ub9cc\ub098\uba74 \ud604\uc7ac \uc2e4\ud589 \uc704\uce58\ub97c \ubcf4\uc874\ud55c \uc0c1\ud0dc\uc5d0\uc11c Coroutine\uc758 \uc2e4\ud589\uc744 \uc7a0\uc2dc \uc911\ub2e8\ud558\uace0 Unity\uc5d0\uac8c \uc81c\uc5b4\uad8c\uc744 \ub118\uae34\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ud6c4 \uc870\uac74\uc774 \ucda9\uc871\ub418\uba74 \uc774\uc804\uc5d0 \uba48\ucdc4\ub358 \uc704\uce58\ubd80\ud130 \ub2e4\uc2dc \uc2e4\ud589\ud55c\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">IEnumerator\uc640 yield<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unity Coroutine\uc740 \uc77c\ubc18\uc801\uc73c\ub85c <code>IEnumerator<\/code>\ub97c \ubc18\ud658\ud558\ub294 \uba54\uc11c\ub4dc\ub85c \uc791\uc131\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private IEnumerator TestCoroutine()\n{\n    Debug.Log(\"Start\");\n\n    yield return new WaitForSeconds(1f);\n\n    Debug.Log(\"End\");\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc5ec\uae30\uc11c \uc911\uc694\ud55c \uac83\uc740 <code>IEnumerator<\/code>\uc640 <code>yield<\/code>\uc758 \uc5ed\ud560\uc774\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>IEnumerator<\/code>\ub294 C#\uc5d0\uc11c \uc5f4\uac70 \uac00\ub2a5\ud55c \ub370\uc774\ud130\ub97c \uc21c\ucc28\uc801\uc73c\ub85c \uc811\uadfc\ud558\uae30 \uc704\ud55c \uc778\ud130\ud398\uc774\uc2a4\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc5d0\uc11c\ub294 \uc774 \uad6c\uc870\ub97c \uc774\uc6a9\ud574 Unity\uac00 \uc2e4\ud589\uc744 \uc911\ub2e8\ud558\uace0 \ub2e4\uc2dc \uc774\uc5b4\uac08 \uc218 \uc788\ub294 \ud615\ud0dc\ub97c \ub9cc\ub4e0\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>yield return<\/code>\uc740 Coroutine\uc758 \uc2e4\ud589\uc744 \uc911\ub2e8\ud558\uace0 Unity\uc5d0\uac8c \uc81c\uc5b4\ub97c \ub118\uae30\ub294 \uc5ed\ud560\uc744 \ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine -&gt; \ucf54\ub4dc \uc2e4\ud589 -&gt; yield return -&gt; Unity\uc5d0 \uc81c\uc5b4\uad8c \uc804\ub2ec -&gt; \uc870\uac74 \ucda9\uc871 -&gt; yield \ub2e4\uc74c \ucf54\ub4dc \uc2e4\ud589\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc608\ub97c \ub4e4\uc5b4 \ub2e4\uc74c \ucf54\ub4dc\ub294<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private IEnumerator TestCoroutine()\n{\n    Debug.Log(\"A\");\n\n    yield return new WaitForSeconds(2f);\n\n    Debug.Log(\"B\");\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ub2e4\uc74c\uacfc \uac19\uc774 \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TestCoroutine() -&gt; A \ucd9c\ub825 -&gt; 2\ucd08 \ub300\uae30 -&gt; B \ucd9c\ub825 -&gt; \uc885\ub8cc\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc911\uc694\ud55c \uc810\uc740 <code>WaitForSeconds<\/code> \ub3d9\uc548 Coroutine \ucf54\ub4dc\uac00 \uacc4\uc18d \uc2e4\ud589\ub418\ub294 \uac83\uc774 \uc544\ub2c8\ub77c\ub294 \uac83\uc774\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud574\ub2f9 Coroutine\uc758 \uc2e4\ud589\uc774 \uc77c\uc2dc\uc801\uc73c\ub85c \uc911\ub2e8\ub418\uace0, Unity\uac00 \uc2dc\uac04\uc774 \uacbd\uacfc\ud588\ub294\uc9c0\ub97c \uad00\ub9ac\ud55c\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uc65c Coroutine\uc744 \uc0ac\uc6a9\ud558\ub294\uac00<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\uac00\uc7a5 \ub300\ud45c\uc801\uc778 \uc774\uc720\ub294 \uc2dc\uac04\uc774\ub098 \ud2b9\uc815 \uc870\uac74\uc744 \uae30\uc900\uc73c\ub85c \uc5ec\ub7ec \ud504\ub808\uc784\uc5d0 \uac78\uccd0 \uc2e4\ud589\ub418\ub294 \ub85c\uc9c1\uc744 \uac04\uacb0\ud558\uac8c \ud45c\ud604\ud560 \uc218 \uc788\uae30 \ub54c\ubb38\uc774\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc608\ub97c \ub4e4\uc5b4 \uc2a4\ud0ac\uc758 \ucfe8\ud0c0\uc784\uc744 \uad6c\ud604\ud55c\ub2e4\uace0 \uc0dd\uac01\ud574\ubcf4\uc790.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>Update()<\/code>\ub97c \uc0ac\uc6a9\ud558\uba74 \ub9e4 \ud504\ub808\uc784\ub9c8\ub2e4 \uc2dc\uac04\uc744 \uac80\uc0ac\ud574\uc57c \ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private float cooldown;\n\nprivate void Update()\n{\n    cooldown -= Time.deltaTime;\n\n    if (cooldown &lt;= 0f)\n    {\n        ActivateSkill();\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ubc18\uba74 Coroutine\uc744 \uc0ac\uc6a9\ud558\uba74 \uc2dc\uac04\uc758 \ud750\ub984\uc744 \ucf54\ub4dc \uc790\uccb4\ub85c \ud45c\ud604\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private IEnumerator Cooldown()\n{\n    yield return new WaitForSeconds(5f);\n\n    ActivateSkill();\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ucf54\ub4dc\uc758 \uc758\ubbf8\uac00 \uba85\ud655\ud558\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine \uc2e4\ud589 -&gt; 5\ucd08 \ub300\uae30 -&gt; \uc2a4\ud0ac \ud65c\uc131\ud654\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ub2e4\ub9cc \uc774\uac83\uc744 &#8220;Coroutine\uc740 \ub9e4 \ud504\ub808\uc784 \uac80\uc0ac\ud558\uc9c0 \uc54a\ub294\ub2e4&#8221;\ub77c\uace0 \uc774\ud574\ud558\uba74 \uc548 \ub41c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>WaitForSeconds<\/code> \uc5ed\uc2dc Unity\uc758 \uc2e4\ud589 \ub8e8\ud504\uc640 \uc5f0\ub3d9\ub418\uc5b4 \uc870\uac74\uc744 \ud655\uc778\ud558\uace0 Coroutine\uc744 \uc7ac\uac1c\ud55c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 CPU \uc791\uc5c5 \uc790\uccb4\ub97c \uc5c6\uc560\ub294 \ucd5c\uc801\ud654 \uae30\ub2a5\uc774 \uc544\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\uc2dc\uac04 \uae30\ubc18 \ub610\ub294 \ud504\ub808\uc784 \uae30\ubc18\uc758 \uc2e4\ud589 \ud750\ub984\uc744 \ud45c\ud604\ud558\uae30 \ud3b8\ud558\uac8c \ub9cc\ub4dc\ub294 \uc2e4\ud589 \ubaa8\ub378\uc5d0 \uac00\uae5d\ub2e4.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine \uc2dc\uc791\ud558\uae30<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unity\uc5d0\uc11c\ub294 <code>StartCoroutine()<\/code>\uc744 \uc0ac\uc6a9\ud574 Coroutine\uc744 \uc2e4\ud589\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private void Start()\n{\n    StartCoroutine(CoroutineA());\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine \uba54\uc11c\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \uc791\uc131\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private IEnumerator CoroutineA()\n{\n    Debug.Log(\"Start\");\n\n    yield return new WaitForSeconds(1f);\n\n    Debug.Log(\"End\");\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc2e4\ud589 \ud750\ub984\uc740 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Start() -&gt; StartCoroutine() -&gt; CoroutineA() -&gt; yield -&gt; 1\ucd08 \ub300\uae30 -&gt; \uc7ac\uac1c -&gt; End \ucd9c\ub825\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine\uc744 \uc911\uc9c0\ud558\uae30<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 <code>StopCoroutine()<\/code>\uc744 \uc774\uc6a9\ud574 \uc911\uc9c0\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uac00\uc7a5 \uad00\ub9ac\ud558\uae30 \uc88b\uc740 \ubc29\uc2dd \uc911 \ud558\ub098\ub294 <code>Coroutine<\/code> \ud578\ub4e4\uc744 \uc800\uc7a5\ud558\ub294 \uac83\uc774\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private Coroutine coroutine;\n\nprivate void Start()\n{\n    coroutine = StartCoroutine(TestCoroutine());\n}\n\nprivate void Stop()\n{\n    StopCoroutine(coroutine);\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774 \ubc29\uc2dd\uc740 \uc5b4\ub5a4 Coroutine\uc744 \uc911\uc9c0\ud560 \uac83\uc778\uc9c0 \uba85\ud655\ud558\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud544\uc694\ud558\ub2e4\uba74 <code>StopAllCoroutines()<\/code>\ub97c \uc0ac\uc6a9\ud560 \uc218\ub3c4 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>StopAllCoroutines();\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774 \uacbd\uc6b0 \ud574\ub2f9 <code>MonoBehaviour<\/code>\uc5d0\uc11c \uc2e4\ud589 \uc911\uc778 \ubaa8\ub4e0 Coroutine\uc774 \uc911\uc9c0\ub41c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub530\ub77c\uc11c \ud2b9\uc815 Coroutine\ub9cc \uc911\uc9c0\ud574\uc57c \ud558\ub294 \uc0c1\ud669\uc5d0\uc11c \ubb34\ubd84\ubcc4\ud558\uac8c \uc0ac\uc6a9\ud558\uba74 \uc548 \ub41c\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ubb38\uc790\uc5f4\ub85c Coroutine\uc744 \uc2e4\ud589\ud558\ub294 \ubc29\uc2dd<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unity\uc5d0\ub294 \ubb38\uc790\uc5f4\uc744 \uc774\uc6a9\ud558\ub294 \ubc29\uc2dd\ub3c4 \uc874\uc7ac\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>StartCoroutine(\"CoroutineC\");\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc911\uc9c0\ub294 \ub2e4\uc74c\uacfc \uac19\uc774 \ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>StopCoroutine(\"CoroutineC\");\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uacfc\uac70 Unity \ucf54\ub4dc\uc5d0\uc11c\ub294 \uc774\ub7f0 \ubc29\uc2dd\ub3c4 \uc0ac\uc6a9\ud588\uc9c0\ub9cc, \uc77c\ubc18\uc801\uc73c\ub85c\ub294 \uba54\uc11c\ub4dc \ud638\ucd9c \ubc29\uc2dd\uc774\ub098 <code>Coroutine<\/code> \ud578\ub4e4\uc744 \uc0ac\uc6a9\ud558\ub294 \ud3b8\uc774 \uba85\ud655\ud558\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud2b9\ud788 \ubb38\uc790\uc5f4 \ubc29\uc2dd\uc740 \ucef4\ud30c\uc77c\ub7ec\uac00 \uba54\uc11c\ub4dc \uc774\ub984\uc744 \uc9c1\uc811 \uac80\uc99d\ud558\uc9c0 \ubabb\ud558\uae30 \ub54c\ubb38\uc5d0 \ub9ac\ud329\ud130\ub9c1\uc774\ub098 \uc624\ud0c0\uc5d0 \ucde8\uc57d\ud558\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub530\ub77c\uc11c \ud2b9\ubcc4\ud55c \uc774\uc720\uac00 \uc5c6\ub2e4\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \ubc29\uc2dd\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>StartCoroutine(TestCoroutine());\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub9ac\uace0 \uc911\uc9c0\uac00 \ud544\uc694\ud558\ub2e4\uba74 \ud578\ub4e4\uc744 \uc800\uc7a5\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private Coroutine coroutine;\n\nprivate void Start()\n{\n    coroutine = StartCoroutine(TestCoroutine());\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine\uacfc \ube44\ub3d9\uae30 \ucc98\ub9ac<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc744 \ucc98\uc74c \uc811\ud558\uba74 <code>async\/await<\/code>\ub098 \uba40\ud2f0\uc2a4\ub808\ub4dc\uc640 \ube44\uc2b7\ud55c \uae30\ub2a5\uc774\ub77c\uace0 \uc0dd\uac01\ud558\uae30 \uc27d\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud558\uc9c0\ub9cc \ub3d9\uc77c\ud55c \uac1c\ub150\uc740 \uc544\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \uae30\ubcf8\uc801\uc73c\ub85c Unity\uc758 \uba54\uc778 \uc2a4\ub808\ub4dc \uc2e4\ud589 \ud750\ub984 \uc548\uc5d0\uc11c \ub3d9\uc791\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine != Thread\nCoroutine != async\/await\nCoroutine != \ubcd1\ub82c \uc2e4\ud589\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \uc791\uc5c5\uc744 \uc5ec\ub7ec \ud504\ub808\uc784\uc5d0 \ub098\ub204\uac70\ub098 \ud2b9\uc815 \uc870\uac74\uae4c\uc9c0 \uc2e4\ud589\uc744 \uc911\ub2e8\ud558\ub294 \ubc29\uc2dd\uc774\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\uc608\ub97c \ub4e4\uc5b4 \ub2e4\uc74c \ucf54\ub4dc\uc5d0\uc11c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private IEnumerator TestCoroutine()\n{\n    HeavyCalculation();\n\n    yield return null;\n\n    AnotherCalculation();\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>yield return null<\/code>\uc744 \uc0ac\uc6a9\ud558\uba74 \ub2e4\uc74c \ud504\ub808\uc784\uae4c\uc9c0 \uc2e4\ud589\uc744 \ub118\uae38 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud558\uc9c0\ub9cc <code>HeavyCalculation()<\/code> \uc790\uccb4\uac00 \ub9e4\uc6b0 \ubb34\uac70\uc6b4 \uc791\uc5c5\uc774\ub77c\uba74 Coroutine\uc744 \uc0ac\uc6a9\ud55c\ub2e4\uace0 \ud574\uc11c \ud574\ub2f9 \uacc4\uc0b0\uc774 \ubcc4\ub3c4\uc758 \uc2a4\ub808\ub4dc\uc5d0\uc11c \uc2e4\ud589\ub418\ub294 \uac83\uc740 \uc544\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub530\ub77c\uc11c \ubb34\uac70\uc6b4 CPU \uc791\uc5c5\uc744 \ubcd1\ub82c \ucc98\ub9ac\ud558\uae30 \uc704\ud55c \uc218\ub2e8\uc73c\ub85c Coroutine\uc744 \uc0ac\uc6a9\ud558\uba74 \uc548 \ub41c\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine\uc5d0\uc11c \uc790\uc8fc \uc0ac\uc6a9\ud558\ub294 yield<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Unity\uc5d0\uc11c\ub294 \uc5ec\ub7ec \uc885\ub958\uc758 <code>yield return<\/code>\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yield return null;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ub2e4\uc74c \ud504\ub808\uc784\uae4c\uc9c0 \uc2e4\ud589\uc744 \ub118\uae30\ub294 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yield return new WaitForSeconds(1f);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc9c0\uc815\ub41c \uc2dc\uac04 \uc774\ud6c4 Coroutine\uc744 \uc7ac\uac1c\ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yield return new WaitUntil(() =&gt; condition);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc870\uac74\uc774 <code>true<\/code>\uac00 \ub420 \ub54c\uae4c\uc9c0 \uae30\ub2e4\ub9b0\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yield return new WaitWhile(() =&gt; condition);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc870\uac74\uc774 <code>true<\/code>\uc778 \ub3d9\uc548 \uae30\ub2e4\ub9b0\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub530\ub77c\uc11c Coroutine\uc740 \ub2e8\uc21c\ud55c \uc2dc\uac04 \uc9c0\uc5f0\ubfd0\ub9cc \uc544\ub2c8\ub77c \uac8c\uc784 \ud50c\ub808\uc774\uc758 \uc21c\ucc28\uc801\uc778 \ud750\ub984\uc744 \ud45c\ud604\ud558\ub294 \ub370 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\uac8c\uc784 \uc2dc\uc791 -&gt; \uc5f0\ucd9c \uc2e4\ud589 -&gt; \ub300\uae30 -&gt; \uc560\ub2c8\uba54\uc774\uc158 \uc7ac\uc0dd -&gt; \ub300\uae30 -&gt; \ud50c\ub808\uc774\uc5b4 \uc785\ub825 \ud65c\uc131\ud654\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uc774\ub7f0 \ud750\ub984\uc744 Coroutine\uc73c\ub85c \uc791\uc131\ud558\uba74 \uc0c1\ud0dc\ub97c \uc9c1\uc811 \uad00\ub9ac\ud558\ub294 \ucf54\ub4dc\ubcf4\ub2e4 \uc77d\uae30 \uc26c\uc6cc\uc9c0\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Coroutine\uc744 \uc0ac\uc6a9\ud560 \ub54c \uc8fc\uc758\ud560 \uc810<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \ud3b8\ub9ac\ud558\uc9c0\ub9cc \ubaa8\ub4e0 \ub85c\uc9c1\uc744 Coroutine\uc73c\ub85c \uc791\uc131\ud558\ub294 \uac83\uc740 \uc88b\uc740 \uc124\uacc4\uac00 \uc544\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ud2b9\ud788 <code>Update()<\/code>\ub85c \ucc98\ub9ac\ud558\ub294 \uac83\uc774 \uc790\uc5f0\uc2a4\ub7ec\uc6b4 \uc9c0\uc18d\uc801\uc778 \uc0c1\ud0dc \uac10\uc2dc\ub97c \ubb34\uc870\uac74 Coroutine\uc73c\ub85c \ubc14\uafc0 \ud544\uc694\ub294 \uc5c6\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub610\ud55c Coroutine\uc740 \ud574\ub2f9 <code>MonoBehaviour<\/code>\uc640 \uc0dd\uba85\uc8fc\uae30 \uad00\uacc4\uac00 \uc788\uae30 \ub54c\ubb38\uc5d0 \uc624\ube0c\uc81d\ud2b8\uac00 \ube44\ud65c\uc131\ud654\ub418\uac70\ub098 \ud30c\uad34\ub418\ub294 \uc0c1\ud669\uc744 \uace0\ub824\ud574\uc57c \ud55c\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc744 \uc5ec\ub7ec \uac1c \uc2e4\ud589\ud558\ub294 \uacbd\uc6b0\uc5d0\ub294 \uac01\uac01\uc758 Coroutine\uc774 \uc5b8\uc81c \uc2dc\uc791\ub418\uace0 \uc5b8\uc81c \uc885\ub8cc\ub418\ub294\uc9c0\ub3c4 \uad00\ub9ac\ud574\uc57c \ud55c\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine \uc99d\uac00 -&gt; \uc2e4\ud589 \ud750\ub984 \uc99d\uac00 -&gt; \uc0c1\ud0dc \uad00\ub9ac \uc99d\uac00 -&gt; \ub514\ubc84\uae45 \ubcf5\uc7a1\ub3c4 \uc99d\uac00\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\ub530\ub77c\uc11c Coroutine\uc740 &#8220;\ube44\ub3d9\uae30 \uc791\uc5c5\uc744 \uc704\ud55c \ub9cc\ub2a5 \ub3c4\uad6c&#8221;\uac00 \uc544\ub2c8\ub77c <strong>\uc2dc\uac04\uacfc \ud504\ub808\uc784\uc744 \uae30\uc900\uc73c\ub85c \uc2e4\ud589 \ud750\ub984\uc744 \ub098\ub204\uae30 \uc704\ud55c \ub3c4\uad6c<\/strong>\ub77c\uace0 \uc774\ud574\ud558\ub294 \uac83\uc774 \uc815\ud655\ud558\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uc815\ub9ac<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc758 \ud575\uc2ec\uc740 <code>yield<\/code>\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine -&gt; \uc2e4\ud589 -&gt; yield -&gt; \uc2e4\ud589 \uc911\ub2e8 -&gt; \uc870\uac74 \ucda9\uc871 -&gt; \uc774\uc804 \uc704\uce58\ubd80\ud130 \uc7ac\uac1c\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>IEnumerator<\/code>\ub294 Coroutine\uc758 \uc2e4\ud589 \uc0c1\ud0dc\ub97c \ud45c\ud604\ud558\ub294 \uae30\ubc18\uc774 \ub418\uace0, <code>yield return<\/code>\uc740 Unity\uc5d0\uac8c \uc2e4\ud589\uc744 \uc7a0\uc2dc \ub118\uae30\ub294 \uc9c0\uc810\uc744 \ub9cc\ub4e0\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ub300\ud45c\uc801\uc778 \uc0ac\uc6a9\ucc98\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\uc2dc\uac04 \uc9c0\uc5f0 \/ \uc5f0\ucd9c \uc2dc\ud000\uc2a4 \/ \uc560\ub2c8\uba54\uc774\uc158 \uc21c\ucc28 \ucc98\ub9ac \/ \ucfe8\ud0c0\uc784 \/ \ubc18\ubcf5\uc801\uc778 \ud504\ub808\uc784 \ubd84\ud560 \uc791\uc5c5 \/ \uc870\uac74 \ub300\uae30\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uadf8\ub9ac\uace0 \uac00\uc7a5 \uc911\uc694\ud55c \uad6c\ubd84\uc740 \uc774\uac83\uc774\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Coroutine -&gt; \uc2e4\ud589 \ud750\ub984 \uc81c\uc5b4\nThread -&gt; \ubcd1\ub82c \uc2e4\ud589\nasync\/await -&gt; \ube44\ub3d9\uae30 \uc791\uc5c5 \ubaa8\ub378\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Coroutine\uc740 \uc131\ub2a5\uc744 \uc790\ub3d9\uc73c\ub85c \uac1c\uc120\ud574\uc8fc\ub294 \uae30\ub2a5\uc774 \uc544\ub2c8\ub2e4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\ubcf5\uc7a1\ud55c \uc2dc\uac04 \uae30\ubc18 \ub85c\uc9c1\uc744 <strong>\uc77d\uae30 \uc27d\uace0 \uc21c\ucc28\uc801\uc778 \ucf54\ub4dc\ub85c \ud45c\ud604\ud560 \uc218 \uc788\uac8c \ud574\uc8fc\ub294 Unity\uc758 \uc2e4\ud589 \ubaa8\ub378<\/strong>\uc774\ub77c\uace0 \ubcf4\ub294 \uac83\uc774 \uac00\uc7a5 \uc815\ud655\ud558\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unity\uc5d0\uc11c \ud2b9\uc815 \uc791\uc5c5\uc744 \uc77c\uc815 \uc2dc\uac04 \ub4a4\uc5d0 \uc2e4\ud589\ud558\uac70\ub098 \uc5ec\ub7ec \ud504\ub808\uc784\uc5d0 \uac78\uccd0 \uc21c\ucc28\uc801\uc73c\ub85c \ucc98\ub9ac\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \uc788\ub2e4. \ub300\ud45c\uc801\uc778 \ubc29\ubc95\uc774 Update()\uc5d0\uc11c \uc2dc\uac04\uc744 \uc9c1\uc811 \uacc4\uc0b0\ud558\ub294 \uac83\uc774\ub2e4. \ub3d9\uc791 \uc790\uccb4\ub294 \ubb38\uc81c\uac00 \uc5c6\ub2e4. \ud558\uc9c0\ub9cc \ub2e8\uc21c\ud788 &#8220;5\ucd08 \uae30\ub2e4\ub9b0 \ub4a4 \uc2e4\ud589\ud55c\ub2e4&#8221;\ub77c\ub294 \ub85c\uc9c1\uc744 \ud45c\ud604\ud558\uae30\uc5d0\ub294 \ucf54\ub4dc\uac00 \ubd88\ud544\uc694\ud558\uac8c \ubcf5\uc7a1\ud574\uc9c4\ub2e4. \uc774\ub7f4 \ub54c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 Coroutine\uc774\ub2e4. Coroutine\uc774\ub780 Coroutine\uc740 \uc77c\ubc18\uc801\uc778 \ud568\uc218\ucc98\ub7fc \ud55c \ubc88 \ud638\ucd9c\ud574\uc11c \ub05d\uae4c\uc9c0 \uc2e4\ud589\ud558\ub294 \ubc29\uc2dd\uacfc \ub2e4\ub974\uac8c, \uc2e4\ud589\uc744 \uc911\uac04\uc5d0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[],"class_list":["post-2083","post","type-post","status-publish","format-standard","hentry","category-game"],"_links":{"self":[{"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/posts\/2083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2083"}],"version-history":[{"count":2,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/posts\/2083\/revisions"}],"predecessor-version":[{"id":2085,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=\/wp\/v2\/posts\/2083\/revisions\/2085"}],"wp:attachment":[{"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wayhope.kro.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}