赞
踩
private IEnumerator EndOfGame(string winner, int score)
{
float timer = 5.0f;
while (timer > 0.0f)
{
InfoText.text = string.Format("Player {0} won with {1} points.\n\n\nReturning to login screen in {2} seconds.", winner, score, timer.ToString("n2"));
yield return new WaitForEndOfFrame();
timer -= Time.deltaTime;
}
PhotonNetwork.LeaveRoom();
}
yield return new WaitForEndOfFrame();执行顺序可以说是等当前帧执行完之后紧接执行后面程序,在本例中就是计时器计时。Lateupdate()之后执行。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。