Exemplo n.º 1
0
        private void InitGame()
        {
            DontDestroyOnLoad(gameObject);

            // 应用基本设置
            Screen.sleepTimeout         = SleepTimeout.NeverSleep;
            Application.targetFrameRate = 30;
            QualitySettings.vSyncCount  = 2;
            // 设置屏幕分辨率
            Screen.SetResolution(1136, 640, false);

            // dotween
            DOTween.Init(true, true, LogBehaviour.Default);

            // FairyGUI 设置
            GRoot.inst.SetContentScaleFactor(1136, 640, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight);

            // 初始化 BaseBehaviour
            BaseBehaviour.InitBaseBehaviour();

            // 设置初始场景
            Game.GetManager <GSceneManager>().InitializeScene();
        }