private void ChangeAtmosphere() { float time = 0f; if (this._type == 2) { time = 18f; } else if (this._type == 1) { time = 12f; } else if (this._type == 3) { time = 18f; } ConfigAtmosphereSeries series = ConfigAtmosphereSeries.LoadFromFileAndDetach(ATMOSPHERE_PATH); int key = series.KeyBeforeTime(time); ConfigAtmosphere config = series.Value(key); if (this._mainMenuStage != null) { this._mainMenuStage.SetupAtmosphere(series.Common, config); this._mainMenuStage.IsUpdateAtmosphereAuto = false; this._mainMenuStage.ForceUpdateAtmosphere = false; } }
private bool OnShowDefaultWeatherNotify() { ConfigAtmosphereSeries config = ConfigAtmosphereSeries.LoadFromFileAndDetach(Singleton <MiHoYoGameData> .Instance.LocalData.CurrentWeatherConfigPath); int currentWeatherSceneID = Singleton <MiHoYoGameData> .Instance.LocalData.CurrentWeatherSceneID; base.view.transform.GetComponent <MainMenuStage>().ChooseCloudScene(config, currentWeatherSceneID); return(false); }
private bool OnShowThunderWeatherNotify() { MainMenuStage component = base.view.transform.GetComponent <MainMenuStage>(); ConfigAtmosphereSeries config = ConfigAtmosphereSeries.LoadFromFileAndDetach("Rendering/MainMenuAtmosphereConfig/Lightning"); component.ChooseCloudScene(config, 0); UserLocalDataItem localData = Singleton <MiHoYoGameData> .Instance.LocalData; localData.StartDirtyCheck(); if ((localData.CurrentWeatherConfigPath != "Rendering/MainMenuAtmosphereConfig/Lightning") || (localData.CurrentWeatherSceneID != 0)) { localData.SetDirty(); } localData.CurrentWeatherConfigPath = "Rendering/MainMenuAtmosphereConfig/Lightning"; localData.CurrentWeatherSceneID = 0; if (localData.EndDirtyCheck()) { Singleton <MiHoYoGameData> .Instance.Save(); } return(false); }
private bool OnShowRandomWeatherNotify() { string pathRandomly = AtmosphereSeriesData.GetPathRandomly(); ConfigAtmosphereSeries config = ConfigAtmosphereSeries.LoadFromFileAndDetach(pathRandomly); int sceneIdRandomly = config.GetSceneIdRandomly(); base.view.transform.GetComponent <MainMenuStage>().ChooseCloudScene(config, sceneIdRandomly); UserLocalDataItem localData = Singleton <MiHoYoGameData> .Instance.LocalData; localData.StartDirtyCheck(); if ((localData.CurrentWeatherConfigPath != pathRandomly) || (localData.CurrentWeatherSceneID != sceneIdRandomly)) { localData.SetDirty(); } localData.CurrentWeatherConfigPath = pathRandomly; localData.CurrentWeatherSceneID = sceneIdRandomly; if (localData.EndDirtyCheck()) { Singleton <MiHoYoGameData> .Instance.Save(); } return(false); }