Question by
CupicuM · Dec 22, 2016 at 06:37 AM ·
c#ienumeratorworkdont
IEnumeration dont do the next lines after the yield return
I'm trying to make a image fade, until de first Yield the code works alright, but when the FadeIn over the IEnumerator dont do the next lines.
I have a IEnumerator in another part of my project and them works correctly. I dont know why this dont work...
Somebody knows?..
void Start (){
StartCoroutine(onFade());
}
//public string loadlevel;
IEnumerator onFade()
{
Splashimg.canvasRenderer.SetAlpha(0.0f);
FadeIn();
yield return new WaitForSeconds (2.5f);
FadeOut();
yield return new WaitForSeconds (2.5f);
SceneManager.LoadScene (0, LoadSceneMode.Single);
}
void FadeIn(){
Debug.LogError ("FADE ooooo");
Splashimg.CrossFadeAlpha(1.0f, 5.5f, false);
}
void FadeOut(){
Debug.LogError ("FADE IN");
Splashimg.CrossFadeAlpha(0.0f, 2.5f, false);
}
Comment