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***n()
{
Debug.Log("start***n a thread");
do{
Thread.Sleep(1000);
Debug.Log("in child thread"+"count="+count);
count++;
}while(count <20);
Debug.Log("end thread");
}
}
public class AAaA : 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***n));
newThrd.Start();
}
// Update is called once per frame
void Update () {
Debug.Log(Time.time);