代码如下:
IEnumerator cutTime(float timer) { while (timer >-1) { yield return new WaitForSeconds(1); Debug.Log(timer); if (timer == 0) { Debug.Log("需要执行的方法"); } timer--; } }
此博客出自TaoHu,转载请注明原文地址 |
博客地址:http://www.cnblogs.com/htwzl/ |
-- Unity3D 学习交流 --