public IEnumerator LoadNextLevel()
{
float t = 0f;
while (t < fadeTime)
{
c.a = t/fadeTime;
t += Time.deltaTime;
yield return 0;
}
c = Color.white; t = fadeTime;
yield return new WaitForSeconds(fadeTime);
while (t > 0f)
{
c.a = t/fadeTime;
t -= Time.deltaTime;
yield return 0;
}
isLoading = true;
c.a = 0f; t = 0f;
tex = tex2;
while (t < fadeTime)
{
c.a = t/fadeTime;
t += Time.deltaTime;
yield return 0;
}
c = Color.white; t = fadeTime;
yield return 0;
AsyncOperation async = ApplicationEx.Instance.LoadLevelAdditiveAsync(Application.loadedLevel+1);
yield return async;
while (t > 0f)
{
c.a = t/fadeTime;
camera.backgroundColor = new Color(0f, 0f, 0f, t/fadeTime);
t -= Time.deltaTime;
yield return 0;
}
Destroy(gameObject);
}
}