【发布时间】:2019-05-17 17:56:39
【问题描述】:
当触发器被激活时,一个面板应该会淡入,然后应该加载一个新场景。不幸的是,这些事情中只发生了一件。
我希望一个接一个地发生。
public void transitionpef()
{
StartCoroutine(panelfadewhite());
}
public IEnumerator panelfadewhite()
{
float ElapsedTime = 0f;
float TotalTime = 2f;
while (ElapsedTime < TotalTime)
{
ElapsedTime += Time.deltaTime;
panel.color = Color.Lerp(new Color(1.0f, 1.0f, 1.0f, 0), new Color(1.0f, 1.0f, 1.0f, 1), (ElapsedTime / TotalTime));
yield return new WaitForSeconds(3);
SceneManager.LoadScene("selection_ui", LoadSceneMode.Single);
yield return null;
}
}
【问题讨论】: