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 int PushRenderingData(string renderingDataName, float transitDuration) { this.TrySetMiddleRenderingForBase(); ConfigStageRenderingData renderingDataByName = this.GetRenderingDataByName(renderingDataName); return(this._renderingDataStack.Push(new RenderingDataTransition(renderingDataByName, transitDuration), false)); }
public void SetRenderingDataImmediately(ConfigStageRenderingData targetRenderingData) { this._currentRendertingData = (ConfigStageRenderingData)targetRenderingData.Clone(); if (this._renderingDataState == RenderingDataState.RenderingTransit) { this._renderingDataState = RenderingDataState.Idle; this._renderingDataTransitionTimer.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); }
public virtual void Awake() { this._renderingDataStack = new FixedStack <RenderingDataTransition>(10, new Action <RenderingDataTransition, int, RenderingDataTransition, int>(this.OnRenderingDataChanged)); this._currentRendertingData = null; this._renderingDataTransitionTimer = new EntityTimer(0f); this._renderingDataTransitionTimer.SetActive(false); this._renderingDataState = RenderingDataState.Idle; this._mainCameraTransform = Camera.main.transform; this._subWeatherStack = new FixedStack <SubWeatherTransition>(5, new Action <SubWeatherTransition, int, SubWeatherTransition, int>(this.OnSubWeatherChanged)); this._rainPrefab = Miscs.LoadResource <GameObject>(this.RAIN_PREFAB_PATH, BundleType.RESOURCE_FILE); this._weatherState = WeatherState.Idle; this._weatherTransitionTimer = new EntityTimer(0f); this._weatherTransitionTimer.SetActive(false); }
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); }
private ConfigWeatherData GetWeatherDataByName(string name) { ConfigWeatherData data = !string.IsNullOrEmpty(name) ? WeatherData.GetWeatherDataConfig(name) : new ConfigWeatherData(); if (data.configRenderingData == null) { if (this._currentRendertingData != null) { data.configRenderingData = this._currentRendertingData.Clone(); } else { data.configRenderingData = ConfigStageRenderingData.CreateDefault(); } } if (data.configSubWeathers == null) { data.configSubWeathers = new ConfigSubWeatherCollection(); } return(data); }
public RenderingDataTransition(ConfigStageRenderingData data, float duration) { this.transitDuration = 0.5f; this.renderingData = data; this.transitDuration = duration; }
public RenderingDataTransition(ConfigStageRenderingData data) { this.transitDuration = 0.5f; this.renderingData = data; }
public void SetBaseRenderingData(string renderingDataName, float duration) { ConfigStageRenderingData renderingDataByName = this.GetRenderingDataByName(renderingDataName); this._renderingDataStack.Set(0, new RenderingDataTransition(renderingDataByName, duration), false); }
public void SetBaseRenderingData(ConfigStageRenderingData renderingData, float duration) { this._renderingDataStack.Set(0, new RenderingDataTransition(renderingData, duration), false); }
public int PushRenderingData(ConfigStageRenderingData renderingData, float transitDuration) { this.TrySetMiddleRenderingForBase(); return(this._renderingDataStack.Push(new RenderingDataTransition(renderingData, transitDuration), false)); }
private ConfigStageRenderingData GetRenderingDataByName(string name) { return(!string.IsNullOrEmpty(name) ? RenderingData.GetRenderingDataConfig <ConfigStageRenderingData>(name) : ConfigStageRenderingData.CreateStageRenderingDataFromMaterials(this.CollectSharedMaterials())); }
public static ConfigWeatherData CrateDefault() { return(new ConfigWeatherData { configRenderingData = ConfigStageRenderingData.CreateDefault(), configSubWeathers = ConfigSubWeatherCollection.CreateDefault() }); }