Last active
August 31, 2018 07:54
-
-
Save todorok1/485aefb9a85ff2ff9da54ed48b3b03a9 to your computer and use it in GitHub Desktop.
Unity APIを別スレッドで呼んでみるテスト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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