Unity3D多线程
来源:互联网 发布:求不定积分的软件 编辑:程序博客网 时间:2024/05/02 04:40
using UnityEngine;
using System.Collections;
using System.Threading;
public class MyThread
{
public int count;
string thrdName;
public MyThread(string nam)
{
count = 0;
thrdName = nam;
}
public void run()
{
Debug.Log("start run a thread"+Time.time);
do{
Thread.Sleep(1000);
Debug.Log("in child thread"+Time.time+"count="+count);
count++;
}while(count <20);
Debug.Log("end thread"+Time.time);
}
}
public class testThread : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("start main"+Time.time);
MyThread mt = new MyThread("CHILE ");
Thread newThrd = new Thread(new ThreadStart(mt.run));
newThrd.Start();
}
// Update is called once per frame
void Update () {
Debug.Log(Time.time);
}
}
using System.Collections;
using System.Threading;
public class MyThread
{
public int count;
string thrdName;
public MyThread(string nam)
{
count = 0;
thrdName = nam;
}
public void run()
{
Debug.Log("start run a thread"+Time.time);
do{
Thread.Sleep(1000);
Debug.Log("in child thread"+Time.time+"count="+count);
count++;
}while(count <20);
Debug.Log("end thread"+Time.time);
}
}
public class testThread : MonoBehaviour {
// Use this for initialization
void Start () {
Debug.Log("start main"+Time.time);
MyThread mt = new MyThread("CHILE ");
Thread newThrd = new Thread(new ThreadStart(mt.run));
newThrd.Start();
}
// Update is called once per frame
void Update () {
Debug.Log(Time.time);
}
}
0 0
- Unity3d多线程
- Unity3D多线程
- Unity3d多线程
- unity3d多线程处理
- Unity3D多线程写法
- Unity3d 协程 多线程 异步区别
- 关于如何导出 unity3d 如何调式多线程
- 解析Unity3D多线程之间的事件派发
- Unity3d 多线程、多并发网络解决方案(C#)
- unity3d之http多线程异步资源下载
- Unity3D之http多线程异步资源下载
- Unity3d Thread多线程,Queue队列,lock关键字
- Unity3D 海水多线程渲染算法实现
- Unity3D 海水多线程渲染算法实现
- Unity3d +vs2012 多线程.多并发网络解决方案(C#)
- Unity3D游戏开发之多线程及使用多线程
- [原]unity3d之http多线程异步资源下载
- Unity3d +vs2015 多线程.多并发网络解决方案(C#)
- 深入PHP内核(三)——内核利器哈希表与哈希碰撞攻击
- JAVA学习第五十二课 — IO流(六)File对象
- java 入门-接口
- Linux C 实现最简单的ICMP_ECHO请求报文发送
- setsid创建会话组
- Unity3D多线程
- 【MongoDB】以前学习mongodb知识的补充
- python 爬虫 怎样写能提取出文件
- 漫谈jdbc
- mongodb资料整理
- Program work 2. Random walk
- 输入英文段落,删除其中的重复单词。即每个单词只出现一次
- DirectX 读书笔记(14) Cube mapping之SkyBox
- MySQL中的sql语法及部分内在实现