unity : waitforsecondsが動かない時
ちょっと
IEnumerator Example() {
print(Time.time);
yield return new WaitForSeconds(5);
print(Time.time);
}
がなぜか動かない・・・
WaitForEndOfFrame
は問題なく動く
なんでかな・・・と思っていたら停止処理で
Time.timeScale = 0;
としていたので動かなかった。
待ちのときだけ timeScale を1に戻して。
WaiteForSeconds(1);
の後に timeScale を 0に戻した。
ゲーム中のポーズではこれは使えないけど・・・終了後の得点表示なので今回はこれで。