测试结果为关闭游戏,会调用OnDestroy().但OnApplicationQuit()比它提前调。

 

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour
{
    void OnApplicationQuit()
    {
        Debug.Log("111");
    }

    void OnDestroy()
    {
        Debug.Log("222");
    }
}
View Code

相关文章:

  • 2022-01-02
  • 2021-08-30
  • 2021-06-10
  • 2021-06-11
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-04
  • 2022-12-23
  • 2021-07-01
  • 2021-10-29
  • 2021-11-20
  • 2021-04-05
  • 2021-12-19
相关资源
相似解决方案