Unity3D开启协程倒计时

来源:互联网 发布:python 拉钩 源代码 编辑:程序博客网 时间:2024/06/06 14:01
代码如下:

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

 

原创粉丝点击