可以帮我翻译一下这段英文吗(关于协程的描述)

来源:百度知道 编辑:UC知道 时间:2024/06/07 20:49:47
参考位置是:http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.StartCoroutine.html

当中的技术关键字是:coroutine(协程) yield(脚本中定义协程的关键字)

The executation of a coroutine can be paused at any point using the yield statement. The yield return value specifies when the coroutine is resumed. Coroutines are excellent when modelling behaviour over several frames. Coroutines have virtually no performance overhead. StartCoroutine function always returns immediately, however you can yield the result. This will wait until the couroutine has finished execution.
不好意思,我也会用GOOGLE网上翻译平台......

该可执行程序(executation)的协同程序(coroutine)可以在任何使用yield声明的地方暂停。yield返回值指定何时coroutine被复用。 当模型构建在多个框架上时Coroutines表现优秀。 Coroutines几乎没有任何的性能开销。 ,不论您能否正确得到结果StartCoroutine功能总是能立即返回。这将等到协同程序(couroutine,我怀疑原文此处有误,我当做coroutine翻译了)已完成了可执行程序。

不是太好,我没接触过协成的东东。希望能帮到你。

该executation的coroutine可以在任何时候暂停使用产量发言。产量返回值指定当coroutine复会。 Coroutines良好行为时,模拟多个帧。 Coroutines几乎没有任何的性能开销。 StartCoroutine功能总是立即返回,但是,您可以产生的结果。这将等到couroutine已完成执行。

该executation的coroutine可以在任何时候暂停使用产量发言。产量返回值指定当coroutine复会。 Coroutines良好行为时,模拟多个帧。 Coroutines几乎没有任何的性能开销。 StartCoroutine功能总是立即返回,但是,您可以产生的结果。这将等到couroutine已完成执行。

当使用JavaScript ,没有必要使用StartCoroutine ,编译器会帮您进行此动作。写作时C #代码,你必须拨打StartCoroutine

/ /在这个例子中,我们显示了如何调用一个coroutine ,并继续执行
/ /函数并行。

/ / -在0秒,打印“从0.0 ”
/ / -在0秒,打印“在WaitAndPrint油剂0.0 ”
/ / - 2秒钟后,打印“ WaitAndPrint 2.0 ”
打印( “启动” + Time.time ) ;
/ /启动功能WaitAndPrint作为coroutine 。并等待,直到它完成
WaitAndPrint ( 2.0 ) ;
打印( “在WaitAndPrint油剂” + T