协程函数如下,其中time为总的时间, 1234567891011 IEnumerator (int time){rebornTime = time;while (time > 0){yield return new WaitForSeconds(1);time--;rebornTime = time;}OnReborn();//time=0时执行的函数} 然后通过StartCoroutine(WaitForReborn(TOTAL_TIME))调用该协程。 赞微海报分享
近期评论