Health/Assets/Scripts/Boot.cs

43 lines
996 B
C#

using UnityEngine;
using UnityEngine.Rendering;
public class Boot : MonoBehaviour
{
private bool _isInited = false;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
public static void StopLogo()
{
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
}
private void Awake()
{
//设置屏幕分辨率
Screen.SetResolution(1920, 1080, true);
//设置屏幕刷新率
Application.targetFrameRate = 60;
//设置屏幕不休眠
Screen.sleepTimeout = SleepTimeout.NeverSleep;
_isInited = UIManager.IsInited;
}
private void OnEnable()
{
//加载
//UIManager.Instance.Init();
if (!_isInited)
UIManager.Instance.ShowPanel<SplashUI>();
else
{
UIManager.Instance.LoadReset();
UIManager.Instance.ShowPanel<MainUIPanel>();
}
}
// Update is called once per frame
void Update()
{
}
}