I looked around on here for a way to make my script wait a few seconds and found this article which people recommended. I took some of this code and used it in my game to make it wait but it doesn't act as I want it to. I placed it between two Debug.Log lines but it waits for the designated time and then logs both things at once instead of waiting after the first has triggered.
static void Waiter(){
waitHandle.WaitOne ();
}
Debug.Log (choice);
new Thread (Waiter).Start ();
Thread.Sleep (5000);
waitHandle.Set ();
Debug.Log (enemyChoice);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…