阳仔演笑会3,硫化机厂家,安阳市新闻网
//通过startcoroutine()开始一个协程
//通过stopcoroutine();关闭一个协程
//通过stopallcoroutines()方法来实现关闭所有协程
void start()
{
debug.log("开始协程程序:执行开始时间:"
+ time.time);
startcoroutine("ie_demo1");
//开始2个协程分别输出猪八戒和沙悟净
startcoroutine("ie_demo2");
startcoroutine("ie_demo3");
//关闭输出沙悟净的协程结果只输出了孙悟空 和猪八戒。沙悟净的关闭了。
stopcoroutine("ie_demo3");
}
//简单使用1
ienumerator ie_demo1()
{
debug.log("进入1协程时间:" +
time.time);
yield return new waitforseconds(1);//等待1秒
debug.log("输出孙悟空,时间:" +
time.time);
}
//简单使用2
ienumerator ie_demo2()
{
debug.log("进入2协程时间:" +
time.time);
yield return new waitforseconds(3);//等待3秒
debug.log("输出猪八戒,时间:" +
time.time);
}
//简单使用3
ienumerator ie_demo3()
{
debug.log("进入3协程时间:" +
time.time);
yield return new waitforseconds(3);//等待3秒
debug.log("输出沙悟净,时间:" +
time.time);
}
更多unity2018的功能介绍请到paws3d爪爪学院查找。
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论