| 123456789101112131415161718192021222324 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- /* 程序启动入口 */
- public class Entry : MonoBehaviour
- {
- void Start()
- {
- Screen.orientation = ScreenOrientation.AutoRotation;//设置方向为自动(根据需要自动旋转屏幕朝向任何启用的方向。)
- Screen.autorotateToLandscapeRight = true; //允许自动旋转到右横屏
- Screen.autorotateToLandscapeLeft = true; //允许自动旋转到左横屏
- Screen.autorotateToPortrait = false; //不允许自动旋转到纵向
- Screen.autorotateToPortraitUpsideDown = false; //不允许自动旋转到纵向上下
- Screen.sleepTimeout = SleepTimeout.NeverSleep; //睡眠时间为从不睡眠
- //没登录过就进入登录界面,有登录信息就直接进入主界面
- if (LoginMgr.CheckAutoLogin()) {
- SceneManager.LoadScene("Home", LoadSceneMode.Single);
- } else {
- SceneManager.LoadScene("Login", LoadSceneMode.Single);
- }
- }
- }
|