在解除iOS模式(Unity 3D)后产生WaitForSeconds中断

时间:2014-05-01 16:07:52

标签: ios unity3d unityscript

如果我以前查看了iOS模式,例如Chartboost“更多应用”或GameCenter排行榜,则我对yield WaitForSeconds的JavaScript调用无法完成。

代码:

function GoToScene(){

    GameObject.Find("SceneFader").SendMessage("FadeToBlack");

    GameObject.Find("MenuSounds").SendMessage("Play_select");

    //code does not get past here
    yield WaitForSeconds(0.254);

    //Application.LoadLevel() is never called
    Application.LoadLevel(this.scene);
}

模态是否锁定了所需的线程?

1 个答案:

答案 0 :(得分:2)

模态是冻结时间,我能够使用以下方法修复它:

if (Time.timeScale == 0){
    Time.timeScale = 1;
}