HRB_Mgr.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class HRB_Mgr : MonoBehaviour
  5. {
  6. void Start()
  7. {
  8. Screen.orientation = ScreenOrientation.AutoRotation;//设置方向为自动(根据需要自动旋转屏幕朝向任何启用的方向。)
  9. Screen.autorotateToLandscapeRight = true; //允许自动旋转到右横屏
  10. Screen.autorotateToLandscapeLeft = true; //允许自动旋转到左横屏
  11. Screen.autorotateToPortrait = false; //不允许自动旋转到纵向
  12. Screen.autorotateToPortraitUpsideDown = false; //不允许自动旋转到纵向上下
  13. if (LoginMgr.HasToken()) HRB_ViewMgr.Instance.ShowView<HRB_HomeView>();
  14. else HRB_ViewMgr.Instance.ShowView<HRB_LoginView>();
  15. }
  16. void Update()
  17. {
  18. #if UNITY_EDITOR
  19. if (Input.GetKeyDown(KeyCode.F3))
  20. {
  21. PlayerPrefs.DeleteAll();
  22. Debug.Log("清除所有本地记录");
  23. }
  24. #endif
  25. }
  26. }