public virtual void Init(StageEntry entry, ConfigWeatherData fromWeatherData, string toWeatherName, float renderingTimer, float weatherTimer) { this._currentBaseWeatherName = toWeatherName; ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(toWeatherName); this._currentRendertingData = (ConfigStageRenderingData)fromWeatherData.configRenderingData.Clone(); this._currentRendertingData.ApplyGlobally(); this._initBaseRenderingData = weatherDataByName.configRenderingData as ConfigStageRenderingData; this._renderingDataStack.Push(0, new RenderingDataTransition(this._initBaseRenderingData), true); if (renderingTimer > 0f) { this.TransitRenderingData(this._initBaseRenderingData, renderingTimer); } else { this.SetRenderingDataImmediately(this._initBaseRenderingData); } this.SetSubWeathersImmediately(fromWeatherData.configSubWeathers); this._initBaseSubWeather = weatherDataByName.configSubWeathers; this._subWeatherStack.Push(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true); if (weatherTimer > 0f) { this.TransitSubWeather(this._initBaseSubWeather, weatherTimer); } else { this.SetSubWeathersImmediately(this._initBaseSubWeather); } this.CommonInit(entry); }
public SubWeatherTransition(ConfigSubWeatherCollection data, int renderingIdx) { this.transitDuration = 0.5f; this.stageEffectSettingIndexInStack = -1; this.weather = data; this.renderingIndexInStack = renderingIdx; }
private void SetSubWeathersImmediately(ConfigSubWeatherCollection subWeather) { this.SetSubWeathers(subWeather); this._currentSubWeather = subWeather; if (this._weatherState == WeatherState.WeatherTransit) { this._weatherState = WeatherState.Idle; this._weatherTransitionTimer.Reset(false); } }
public virtual void Reset(StageEntry entry, ConfigWeatherData weatherData) { this._initBaseRenderingData = weatherData.configRenderingData as ConfigStageRenderingData; this._renderingDataStack.Set(0, new RenderingDataTransition(this._initBaseRenderingData), true); this.SetRenderingDataImmediately(this._initBaseRenderingData); this._currentRendertingData.ApplyGlobally(); this._initBaseSubWeather = weatherData.configSubWeathers; this._subWeatherStack.Set(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true); this.SetSubWeathersImmediately(this._initBaseSubWeather); this.CommonInit(entry); }
private ConfigSubWeatherCollection GetCurrentSubWeatherData() { if (this._weatherState == WeatherState.Idle) { return(this._currentSubWeather.Copy()); } if (this._weatherState == WeatherState.WeatherTransit) { return(ConfigSubWeatherCollection.Lerp(this._currentSubWeather, this._transitTargetSubWeather, this._weatherTransitionTimer.GetTimingRatio())); } return(null); }
public virtual void Init(StageEntry entry, string weatherName) { this._currentBaseWeatherName = weatherName; ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(weatherName); this._initBaseRenderingData = weatherDataByName.configRenderingData as ConfigStageRenderingData; this._renderingDataStack.Push(0, new RenderingDataTransition(this._initBaseRenderingData), true); this._currentRendertingData = (ConfigStageRenderingData)this._initBaseRenderingData.Clone(); this._currentRendertingData.ApplyGlobally(); this._initBaseSubWeather = weatherDataByName.configSubWeathers; this._subWeatherStack.Push(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true); this.SetSubWeathersImmediately(this._initBaseSubWeather); this.CommonInit(entry); }
public static ConfigWeatherData LoadFromFile(ConfigWeather config) { if (config == null) { return(null); } ConfigWeatherData data = new ConfigWeatherData(); if (!string.IsNullOrEmpty(config.renderingDataPath)) { data.configRenderingData = ConfigUtil.LoadConfig <ConfigBaseRenderingData>(config.renderingDataPath); } data.configSubWeathers = ConfigSubWeatherCollection.LoadFromFile(config); data.configSubWeathers.stageEffectSetting = config.stageEffectSetting; return(data); }
private void SetSubWeathers(ConfigSubWeatherCollection subWeather) { this.SetRain(subWeather.configRain); }
private void SetBaseSubWeather(ConfigSubWeatherCollection subWeather, float duration) { this._subWeatherStack.Set(0, new SubWeatherTransition(subWeather, 0, duration), false); }
private int PushSubWeatherData(ConfigSubWeatherCollection subWeather, int renderingIdx, int settingIx, float transitDuration) { this.TrySetMiddleSubWeatherForBase(); return(this._subWeatherStack.Push(new SubWeatherTransition(subWeather, renderingIdx, settingIx, transitDuration), false)); }
public static ConfigWeatherData CrateDefault() { return(new ConfigWeatherData { configRenderingData = ConfigStageRenderingData.CreateDefault(), configSubWeathers = ConfigSubWeatherCollection.CreateDefault() }); }