代码如下:
IEnumerator cutTime(float timer) { while (timer >-1) { yield return new WaitForSeconds(1); Debug.Log(timer); if (timer == 0) { Debug.Log("需要执行的方法"); } timer--; } }
代码如下:
IEnumerator cutTime(float timer) { while (timer >-1) { yield return new WaitForSeconds(1); Debug.Log(timer); if (timer == 0) { Debug.Log("需要执行的方法"); } timer--; } }