NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Game/Main.cs

47 lines
995 B
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();
}
private void Update()
{
_game.Update(Time.deltaTime);
}
private void OnApplicationPause(bool pauseStatus)
{
_game.OnApplicationPause(pauseStatus);
}
private void OnDestroy()
{
_game.Release();
SDKManager.Instance.Release();
}
}
}