λ‘νŠΈμœˆμ—μ„œ OnComplete()μ“°λŠ” 것 처럼


μ½”λ£¨ν‹΄μ—μ„œλ„Β 


public IEneumerator Coroutine()

{

Pre();

yield return null;

Main();

yield return null;

Post();

yield return null;

}


μ΄λ ‡κ²Œ μ§„ν–‰λœλ‹€κ³  κ°€μ •ν•  λ•Œ, Pre(); κ°€ μ‹œμž‘λ˜κ³  끝날 λ•Œ κΉŒμ§€ 기닀리고, Preκ°€ λλ‚˜λ©΄ Main()이 μ‹œμž‘λ˜κ³ , Main()이 λλ‚˜λ©΄ Post()κ°€ μ‹œμž‘λ˜κ²Œλ” λ§Œλ“€κ³  μ‹Άκ±°λ“ μš”.


μ§€κΈˆμ€ μ•½κ°„ μ•Όλ§€λ‘œ bool wait λ₯Ό λ§Œλ“€μ–΄μ„œ yield return null μžλ¦¬μ— while(wait){ yield return null; } 둜 ν•΄κ²°ν•˜κ³  있긴 ν•œλ°


더 κΉ”λ”ν•˜κ²Œ ν•΄κ²°ν•  수 μžˆλŠ” 방법이 λΆ„λͺ…νžˆ μžˆμ„ 것 κ°™μ•„μ„œ μ΄λ ‡κ²Œ μ—¬μ­™μŠ΅λ‹ˆλ‹€.


ν˜Ήμ‹œ 쒋은 방법 μžˆμ„κΉŒμš”??