Unity3D/C#
2026. 11. 3.
유니티 코루틴으로 몇 초 뒤 실행 (WaitForSeconds, StopCoroutine)
유니티에서 몇 초 뒤에 어떤 일을 하려면 IEnumerator 를 돌려주는 함수를 만들고, 그 안에서 yield return new WaitForSeconds(초) 로 기다린 뒤 StartCoroutine 으로 시작합니다. 중간에 멈추려면 StartCoroutine 이 돌려준 Coroutine 을 변수에 담아 두었다가 StopCoroutine 에 넣습니다. IEnumerator Hide_Routine(){ yield return new WaitForSeconds(2f); // 2초 기다림 panel_message.SetActive(false); // 그다음 줄이 실행됨}Coroutine routine_hide = StartC..