45 lines
1.1 KiB
C#
45 lines
1.1 KiB
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;
|
|
//设置屏幕方向
|
|
Screen.orientation = ScreenOrientation.LandscapeLeft;
|
|
_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()
|
|
{
|
|
|
|
}
|
|
}
|