IEnumerator GameOverAnimation() { while (true) { maincamera.backgroundCo...
IEnumerator GameOverAnimation()
{
while (true)
{
maincamera.backgroundColor = Color.Lerp(maincamera.backgroundColor,Color.red,speed*Time.deltaTime);
maincamera.orthographicSize = Mathf.Lerp(maincamera.orthographicSize,6,speed*Time.deltaTime);
if (Mathf.Abs(maincamera.orthographicSize-4)<0.01f)
{
break;
}
yield return 0;
}
yield return new WaitForSeconds(1);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}
老师,为什么最后两行代码运行不了?用Debug调试了,输出不出来东西。