ヤ大督DOG屎 发表于 2013-6-22 23:28

unity3D中~JS脚本的yield

function Start ()
{
if (!target)
target = GameObject.FindWithTag("Player").transform;

// Rather than placing this in an update function, we can start the AI's behavior now and
//use coroutines to handle the changes
yield WaitForSeconds(idleTime);

while (true)
{
// Idle around and wait for the player
yield Idle();
// Player has been located, prepare for the attack.
yield Attack();
}
}

function Idle(){......}
function Attack(){......}

请问其中的yield Idle();跟yield Attack();是什么意思?望各位大神出手相助!小弟感激不尽!

yangzhen_010 发表于 2017-2-23 14:44

顶顶多好

罗明工作 发表于 2017-2-23 14:59

真心顶

chunqiu 发表于 2017-2-23 15:03

难得一见的好帖

罗明工作 发表于 2017-2-23 15:23

说的非常好

liuww 发表于 2017-2-23 15:31

很好哦

j717273419 发表于 2017-5-13 10:03

好帖就是要顶

Gs_123 发表于 2017-5-13 09:30

顶顶多好

airstick 发表于 2017-5-13 10:06

真心顶

if?else 发表于 2017-5-13 10:08

很好哦
页: [1] 2 3 4 5 6 7 8 9
查看完整版本: unity3D中~JS脚本的yield