Health/Assets/Scripts/Boot.cs

40 lines
890 B
C#

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