■ 코루틴 개념

○ 코루틴(Coroutine) 설명

○ 코루틴의 기본 구조

using UnityEngine;
using System.Collections;

public class CoroutineExample : MonoBehaviour
{
    void Start()
    {
        StartCoroutine(PrintNumbers());
    }

    IEnumerator PrintNumbers()
    {
        for (int i = 1; i <= 5; i++)
        {
            Debug.Log(i);
            yield return new WaitForSeconds(1f); // 1초 대기
        }
    }
}

○ yield