(一)协程
开启方法:StartCoroutine("函数名");
结束方法StopCoroutine("函数名"),StopAllCoroutines();
IEnumerator TestIEnumerator()
{
Debug.Log("协程");
//等待游戏界面绘制完成
yield return new WaitForEndOfFrame();
Debug.Log("游戏界面绘制完成");
//等待1秒后
yield return new WaitForSeconds(1F);
Debug.Log("1秒后");
//等待0.5秒后
yield return new WaitForSeconds(0.5F);
Debug.Log("0.5秒后");
while(true)
{
//等待固定更新