Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active August 31, 2018 07:54
Show Gist options
  • Save todorok1/485aefb9a85ff2ff9da54ed48b3b03a9 to your computer and use it in GitHub Desktop.
Save todorok1/485aefb9a85ff2ff9da54ed48b3b03a9 to your computer and use it in GitHub Desktop.
Unity APIを別スレッドで呼んでみるテスト
using UnityEngine;
using System.Threading;
public class ThreadTester : MonoBehaviour {
Thread anotherThread;
void Start(){
// 別スレッドを起動
anotherThread = new Thread(AnotherThreadProcess);
anotherThread.Start();
}
void AnotherThreadProcess(){
// Unity APIを呼んでみよう。
gameObject.AddComponent<Rigidbody>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment