zoukankan      html  css  js  c++  java
  • Unity Application 前后台切换调用关系

    Unity Application 前后台切换调用关系

    1、OnApplicationPause

      Sent to all GameObjects when the application pauses.

      On Android, when the on-screen keyboard is enabled, it causes a OnApplicationFocus( false ) event. Additionally, if you press "Home" at the moment the keyboard is enabled, the OnApplicationFocus() event is not called, but OnApplicationPause() is called instead.

    2、OnApplicationFocus

      Sent to all GameObjects when the player gets or loses focus.

      OnApplicationFocus is called when the application loses or gains focus. Alt-tabbing or Cmd-tabbing can take focus away from the Unity application to another desktop application. This causes the GameObjects to receive an OnApplicationFocus call with the argument set to false. When the user switches back to the Unity application, the GameObjects receive anOnApplicationFocus call with the argument set to true.

      On Android, when the on-screen keyboard is enabled, it causes a OnApplicationFocus( false ) event. Additionally, if you pressHome at the moment the keyboard is enabled, the OnApplicationFocus() event is not called, but OnApplicationPause() is called instead.

    3、OnApplicationQuit

      Sent to all game objects before the application is quit.

      In the editor this is called when the user stops playmode.

      Note that iOS applications are usually suspended and do not quit. You should tick "Exit on Suspend" in Player settings for iOS builds to cause the game to quit and not suspend, otherwise you may not see this call. If "Exit on Suspend" is not ticked then you will see calls to OnApplicationPause instead.

    参考:http://blog.csdn.net/aa4790139/article/details/48087877

  • 相关阅读:
    Vue状态管理
    Vue延迟点击
    Vue路由
    简单的队列应用
    Uncaught SyntaxError: Unexpected token )
    视频转码
    判断是否为视频文件
    Press ^C at any time to quit.
    Node.js学习
    YUM安装LAMP与LNMP
  • 原文地址:https://www.cnblogs.com/tekkaman/p/6109742.html
Copyright © 2011-2022 走看看