반응형
StartCoroutine의 반환 시점
StartCoroutine을 호출하면 즉시 Coroutine 객체가 반환됩니다.
코루틴 내부의 코드는 그 다음 프레임부터 실행됩니다.
예제
IEnumerator MyCoroutine()
{
Debug.Log("Coroutine started");
yield return null;
Debug.Log("Coroutine resumed");
}
void Start()
{
Coroutine coroutine = StartCoroutine(MyCoroutine());
Debug.Log("Coroutine returned");
}
위 코드의 Log 출력 순서는 다음과 같습니다.
1. Coroutine Returned
2. Coroutine Started
3. Coroutine Resumed
반응형
LIST
'Unity' 카테고리의 다른 글
다른 캐릭터의 Animation 내 캐릭터에 적용 시키는 방법 (0) | 2025.03.10 |
---|---|
Line Renderer를 활용한 움직이는 플랫폼 구현 (0) | 2025.03.06 |
유니티 Quaternion 사용법 (0) | 2025.03.05 |
Unity 3D TPS 카메라 컨트롤러 구현 (0) | 2025.03.05 |
유니티 무한 로딩 오류 (0) | 2025.02.20 |