48 lines
1.0 KiB
C#
48 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace PhxhSDK
|
|
{
|
|
public class Main : SingletonMono<Main>
|
|
{
|
|
private static Game _game;
|
|
private void Awake()
|
|
{
|
|
SDKManager.GetSingleton().InitEarly();
|
|
DontDestroyOnLoad(gameObject);
|
|
_game = new MyGame();
|
|
if (_game == null)
|
|
{
|
|
DebugUtil.LogError("PhxhSDK.Main: no game instance created");
|
|
}
|
|
SDKManager.GetSingleton().Init();
|
|
_game.Init();
|
|
}
|
|
|
|
|
|
|
|
private void Start()
|
|
{
|
|
_game.Start();
|
|
DebugUtil.LogError("测试IOS 热更新!");
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
_game.Update(Time.deltaTime);
|
|
}
|
|
|
|
private void OnApplicationPause(bool pauseStatus)
|
|
{
|
|
_game.OnApplicationPause(pauseStatus);
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
_game.Release();
|
|
SDKManager.Instance.Release();
|
|
}
|
|
}
|
|
}
|