zoukankan      html  css  js  c++  java
  • unity, iOS下画面错乱解法

    unity版本号为5.1.1f1 Personal

    在ipod5,系统为iOS7.1上测试。发现下面两种出现画面错乱的问题:

    一,退后台在返回前台时画面发生错乱(错乱持续一两秒,然后变为正常)。

     

    二,当弹出iOS原生对话框时画面发生错乱(关闭对话框后恢复正常)。

     

    做了各种尝试,最后终于找到了解决办法:

    在生成的xcode工程中找到UnityAppController.mm,将applicationWillResignActive函数中的下面一段代码注释掉:

    // Force player to do one more frame, so scripts get a chance to render custom screen for minimized app in task manager.

    // NB: UnityWillPause will schedule OnApplicationPause message, which will be sent normally inside repaint (unity player loop)

    // NB: We will actually pause after the loop (when calling UnityPause).

    UnityWillPause();

    [self repaint];

    UnityPause(1);

    _snapshotView = [self createSnapshotView];

    if(_snapshotView)

    {

    [_window addSubview:_snapshotView];

    [_window bringSubviewToFront:_snapshotView];

    }

    即:

       => 

  • 相关阅读:
    javascript DOM事件总结
    MySQL索引优化实例说明
    CSV导出大量数据
    最详细的PHP flush()与ob
    XSS攻击(跨站攻击)
    MySQL视图
    MySQL索引
    待整理
    Height、clientHeight、scrollHeight、offsetHeight 、scrollTop、offsetTop
    Cookie和Session的区别
  • 原文地址:https://www.cnblogs.com/wantnon/p/4745800.html
Copyright © 2011-2022 走看看