2023-12-08 18:41:26 +08:00
|
|
|
using Framework;
|
|
|
|
|
using PhxhSDK;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2023-12-14 14:47:14 +08:00
|
|
|
public class AppManager: Singlenton<AppManager>, IInitable, IUpdatable
|
2023-12-08 18:41:26 +08:00
|
|
|
{
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.Android_Application_Quit, _OnAndroidBack);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Release()
|
|
|
|
|
{
|
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.Android_Application_Quit, _OnAndroidBack);
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-14 14:47:14 +08:00
|
|
|
public void Update(float dt)
|
|
|
|
|
{
|
|
|
|
|
InputManager.Instance.CheckIsBackKeyDown();
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-08 18:41:26 +08:00
|
|
|
private void _OnAndroidBack()
|
|
|
|
|
{
|
|
|
|
|
Application.Quit();
|
|
|
|
|
}
|
|
|
|
|
}
|