Пример #1
0
        public override IEnumerator PerformFirstPass()
        {
            string launchDataReadPath = LaunchDataHelper.GetLaunchDataReadPath();

            if (!string.IsNullOrEmpty(launchDataReadPath) && JsonPersistenceUtility.TryReadJsonData <LaunchData>(launchDataReadPath, out var jsonObject))
            {
                JsonPersistenceUtility.ClearJsonData(launchDataReadPath);
                AudioController audioController = Service.Get <AudioController>();
                if (jsonObject.MusicVolume >= 0f)
                {
                    audioController.SetMusicVolume(jsonObject.MusicVolume);
                }
                if (jsonObject.SFXVolume >= 0f)
                {
                    audioController.SetSFXVolume(jsonObject.SFXVolume);
                }
                if (!Screen.fullScreen && jsonObject.ScreenWidth > 0 && jsonObject.ScreenHeight > 0)
                {
                    CustomGraphicsService customGraphicsService = Service.Get <CustomGraphicsService>();
                    customGraphicsService.TryFitWindowedScreen(jsonObject.ScreenWidth, jsonObject.ScreenHeight);
                }
                if (!string.IsNullOrEmpty(jsonObject.Language))
                {
                    Language language = (Language)Enum.Parse(typeof(Language), jsonObject.Language);
                    Service.Get <GameSettings>().SavedLanguage.SetValue(language);
                    Service.Get <Localizer>().ChangeLanguage(language);
                }
            }
            yield break;
        }
Пример #2
0
        public override IEnumerator PerformFirstPass()
        {
            CustomGraphicsService customGraphicsService = new CustomGraphicsService();

            customGraphicsService.Init();
            Service.Set(customGraphicsService);
            GameObject gameObject = Service.Get <GameObject>();

            gameObject.AddComponent <WindowResizeService>();
            string tier = Screen.width + "x" + Screen.height;

            Service.Get <ICPSwrveService>().Action("desktop_display_settings", "start_resolution", tier);
            yield break;
        }