using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
public class TestThread : MonoBehaviour
{
void Start()
{
Thread thread1 = new Thread(new ThreadStart(F1));
Thread thread2 = new Thread(new ThreadStart(F2));
Thread thread3 = new Thread(new ThreadStart(F3));
thread1.Start();
thread2.Start();
thread3.Start();
}
void F1()
{
Debug.Log(1);
}
void F2()
{
Debug.Log(2);
}
void F3()
{
Debug.Log(3);
}
}
(多线程不按顺序执行)
一般完成延时操作时使用线程。