GameEntry.cs 1.2 KB

12345678910111213141516171819202122232425
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class GameEntry : MonoBehaviour
  5. {
  6. void Awake()
  7. {
  8. ////设置新装app初始语言
  9. PlayerPrefs.SetInt("AppLanguage", 0);
  10. PlayerPrefs.SetInt("Language", 0);
  11. Screen.orientation = ScreenOrientation.AutoRotation;//设置方向为自动(根据需要自动旋转屏幕朝向任何启用的方向。)
  12. Screen.autorotateToLandscapeRight = true; //允许自动旋转到右横屏
  13. Screen.autorotateToLandscapeLeft = true; //允许自动旋转到左横屏
  14. Screen.autorotateToPortrait = false; //不允许自动旋转到纵向
  15. Screen.autorotateToPortraitUpsideDown = false; //不允许自动旋转到纵向上下
  16. Screen.sleepTimeout = SleepTimeout.NeverSleep; //睡眠时间为从不睡眠
  17. //游戏帧率设置,需要在项目设置的Quality中关闭对应画质的垂直同步(VSync选项)
  18. QualitySettings.vSyncCount = 0;
  19. Application.targetFrameRate = 60;
  20. //QualitySettings.vSyncCount = 1;
  21. SimulateMouseController.Init();
  22. }
  23. }