找回密码
 立即注册
查看: 6359|回复: 85

[脚本] unity3D中~JS脚本的yield

[复制链接]
发表于 2013-6-22 23:28 | 显示全部楼层 |阅读模式
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();是什么意思?望各位大神出手相助!小弟感激不尽!

发表于 2017-2-23 14:44 | 显示全部楼层
顶顶多好
发表于 2017-2-23 14:59 | 显示全部楼层
真心顶
发表于 2017-2-23 15:03 | 显示全部楼层
难得一见的好帖
发表于 2017-2-23 15:23 | 显示全部楼层
说的非常好
发表于 2017-2-23 15:31 | 显示全部楼层
很好哦
发表于 2017-5-13 10:03 | 显示全部楼层
好帖就是要顶
发表于 2017-5-13 09:30 | 显示全部楼层
顶顶多好
发表于 2017-5-13 10:06 | 显示全部楼层
真心顶
发表于 2017-5-13 10:08 | 显示全部楼层
很好哦
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Unity开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-5-3 17:13 , Processed in 0.111693 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表