Unity3D协程

作者: 在夢里 | 来源:发表于2018-12-25 20:39 被阅读1次

     voidStart()

        {

           Debug.Log("1");

            StartCoroutine(Do());

           Debug.Log("4");

        }

       IEnumeratorDo()

        {

           Debug.Log("2");

           yieldreturnStartCoroutine(newDo());//WaitForSeconds(5);

           Debug.Log("6");

        }

       IEnumeratornewDo()

        {

           Debug.Log("3");

           yieldreturnnewWaitForSeconds(2);

           Debug.Log("5");

        }

    输出结果 1、2、3、4、5

    相关文章

      网友评论

        本文标题:Unity3D协程

        本文链接:https://www.haomeiwen.com/subject/hyeqlqtx.html