• 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];

    }

    即:

       => 

  • 相关阅读:
    在线程中更新UI
    Panel容器
    ImageList组件
    PrograssBar控件
    PictureBox控件
    GroupBox控件
    Timer控件Forms.Timer\System.Timers.Timer\System.Threading.Timer
    DataGridView控件1——手动添加数据,遍历数据
    SplitContainer控件
    Git理论知识
  • 原文地址:https://www.cnblogs.com/wantnon/p/4745800.html
Copyright © 2020-2023  润新知