在Unity3D中。有yield语句它负责延迟操作,yield return WaitForSeconds(3.0); //等待 3 秒
查看unity3d脚本手冊,使用方法须要在对应的格式。
以下代码含义就是,载入图片显示等待6秒后进入场景level1中。

using UnityEngine;
using System.Collections; public class init : MonoBehaviour { // Use this for initialization
public Texture img;
private bool bl = false;
public float waitTime ;
void Start () {
StartCoroutine( wait(6.0f) ); } // Update is called once per frame
void Update () {
if (bl)
Application.LoadLevel(1); } void OnGUI()
{
GUI.DrawTexture(new Rect(0,0,1024,768),img);
} IEnumerator wait(float time)
{
yield return new WaitForSeconds(waitTime);
bl = true;
}
}

最新文章

  1. iOS开发之再探多线程编程:Grand Central Dispatch详解
  2. Hadoop: MapReduce2的几个基本示例
  3. How to AC it
  4. A Guide to Creating a Quality Project Schedule
  5. Sqli-labs less 32
  6. Linux下用来获取各种系统信息的C++类
  7. CKEditor&ckfindtor
  8. 【转】commons-fileupload-1.2.1.jar和commons-io-1.3.2.jar实现文件上传
  9. ACM/ICPM2014鞍山现场赛D Galaxy (HDU 5073)
  10. jQuery Ajax: $.post请求示例
  11. 打开Openstack dashboard出现Internal Server Error
  12. fgets的用法
  13. BZOJ_1031_[JSOI2007]字符加密Cipher_后缀数组
  14. 关于MDN,HTML入门来自MDN文档
  15. mac os安装多个版本的chrome
  16. mybatis foreach 遍历list中的坑
  17. 洛谷 P2058 海港 解题报告
  18. Ubuntu下Apache虚拟主机+反向代理
  19. Visual Studio Code用户设置文件
  20. C语言程序设计I—第九周教学

热门文章

  1. An internal error occurred during: "Building workspace". java.lang.StackOverflowError
  2. Ural 1152 False Mirrors(状压DP)
  3. Laravel异常处理
  4. vue中使用UEditor编辑器 -- 2
  5. 手把手教你写带登录的NodeJS爬虫+数据展示
  6. learn cmake
  7. AARRR:互联网创业者一定要掌握的指标
  8. python3 pymysql学习笔记
  9. CDR 2017版本LiveSketch工具是什么,怎么用?
  10. 数据库常用sql语句积累