OGeek|极客世界-中国程序员成长平台

标题: ios - 关闭iOS模式后产生WaitForSeconds中断(Unity 3D) [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 09:36
标题: ios - 关闭iOS模式后产生WaitForSeconds中断(Unity 3D)

如果我之前查看过 iOS 模式(例如 Chartboost“更多应用程序”或 GameCenter 排行榜),我对 yield WaitForSeconds 的 JavaScript 调用不会完成。

代码:

function GoToScene(){

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

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

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

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

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



Best Answer-推荐答案


模态框正在卡住时间,我可以使用以下方法修复它:

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

关于ios - 关闭iOS模式后产生WaitForSeconds中断(Unity 3D),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23411597/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4