GameEntry.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132
  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. //int curAppLanguage = PlayerPrefs.GetInt("AppLanguage", -1);
  10. //if (curAppLanguage != CommonConfig.AppLanguage)
  11. //{
  12. // PlayerPrefs.SetInt("AppLanguage", CommonConfig.AppLanguage);
  13. // PlayerPrefs.SetInt("Language", CommonConfig.AppLanguage);
  14. // Debug.Log("SetAppLanguage");
  15. //}
  16. PlayerPrefs.SetInt("AppLanguage", 0);
  17. PlayerPrefs.SetInt("Language", 0);
  18. Screen.orientation = ScreenOrientation.AutoRotation;//设置方向为自动(根据需要自动旋转屏幕朝向任何启用的方向。)
  19. Screen.autorotateToLandscapeRight = true; //允许自动旋转到右横屏
  20. Screen.autorotateToLandscapeLeft = true; //允许自动旋转到左横屏
  21. Screen.autorotateToPortrait = false; //不允许自动旋转到纵向
  22. Screen.autorotateToPortraitUpsideDown = false; //不允许自动旋转到纵向上下
  23. Screen.sleepTimeout = SleepTimeout.NeverSleep; //睡眠时间为从不睡眠
  24. //游戏帧率设置,需要在项目设置的Quality中关闭对应画质的垂直同步(VSync选项)
  25. QualitySettings.vSyncCount = 0;
  26. Application.targetFrameRate = 60;
  27. //QualitySettings.vSyncCount = 1;
  28. SimulateMouseController.Init();
  29. }
  30. }