private void SetupSky(ConfigAtmosphereCommon commonConfig, ConfigBackground config) { if (commonConfig.Tex != null) { this._skyMPB.SetTexture("_MainTex", commonConfig.Tex); this._skyMPB.SetColor("_TexRColor", config.RColor); this._skyMPB.SetColor("_TexGColor", config.GColor); this._skyMPB.SetColor("_TexBColor", config.BColor); this._skyMPB.SetFloat("_TexXLocation", config.XLocation); this._skyMPB.SetFloat("_TexYLocation", config.YLocation); this._skyMPB.SetFloat("_TexHigh", config.High); } if (commonConfig.SecondTex != null) { this._skyMPB.SetTexture("_SecTexture", commonConfig.SecondTex); this._skyMPB.SetFloat("_SecTexXLocation", config.SecTexXLocation); this._skyMPB.SetFloat("_SecTexYLocation", config.SecTexYLocation); this._skyMPB.SetFloat("_SecTexHigh", config.SecTexHigh); this._skyMPB.SetFloat("_SecTexEmission", config.SecTexEmission); } this._skyMPB.SetColor("_GradBottomColor", config.GradBottomColor); this._skyMPB.SetColor("_GradTopColor", config.GradTopColor); this._skyMPB.SetFloat("_GradLocation", config.GradLocation); this._skyMPB.SetFloat("_GradHigh", config.GradHigh); this._skyMPB.SetFloat("_BloomFactor", config.BloomFactor); this._skyRenderer.SetPropertyBlock(this._skyMPB); }
public void CopyFrom(ConfigBackground other) { if (other != null) { this.RColor = other.RColor; this.GColor = other.GColor; this.BColor = other.BColor; this.GradTopColor = other.GradTopColor; this.GradBottomColor = other.GradBottomColor; this.XLocation = other.XLocation; this.YLocation = other.YLocation; this.High = other.High; this.SecTexXLocation = other.SecTexXLocation; this.SecTexYLocation = other.SecTexYLocation; this.SecTexHigh = other.SecTexHigh; this.SecTexEmission = other.SecTexEmission; this.GradLocation = other.GradLocation; this.GradHigh = other.GradHigh; this.BloomFactor = other.BloomFactor; } }
public static ConfigAtmosphere Lerp(ConfigAtmosphere config1, ConfigAtmosphere config2, float t) { ConfigAtmosphere atmosphere; return(new ConfigAtmosphere { FrameTime = Mathf.Lerp(config1.FrameTime, config2.FrameTime, t), Name = atmosphere.FrameTime.ToString(), CloudStyle = ConfigCloudStyle.Lerp(config1.CloudStyle, config2.CloudStyle, t), Background = ConfigBackground.Lerp(config1.Background, config2.Background, t), Indoor = ConfigIndoor.Lerp(config1.Indoor, config2.Indoor, t) }); }
public static ConfigBackground Lerp(ConfigBackground config1, ConfigBackground config2, float t) { return(new ConfigBackground { RColor = Color.Lerp(config1.RColor, config2.RColor, t), GColor = Color.Lerp(config1.GColor, config2.GColor, t), BColor = Color.Lerp(config1.BColor, config2.BColor, t), GradTopColor = Color.Lerp(config1.GradTopColor, config2.GradTopColor, t), GradBottomColor = Color.Lerp(config1.GradBottomColor, config2.GradBottomColor, t), XLocation = Mathf.Lerp(config1.XLocation, config2.XLocation, t), YLocation = Mathf.Lerp(config1.YLocation, config2.YLocation, t), High = Mathf.Lerp(config1.High, config2.High, t), SecTexXLocation = Mathf.Lerp(config1.SecTexXLocation, config2.SecTexXLocation, t), SecTexYLocation = Mathf.Lerp(config1.SecTexYLocation, config2.SecTexYLocation, t), SecTexHigh = Mathf.Lerp(config1.SecTexHigh, config2.SecTexHigh, t), SecTexEmission = Mathf.Lerp(config1.SecTexEmission, config2.SecTexEmission, t), GradLocation = Mathf.Lerp(config1.GradLocation, config2.GradLocation, t), GradHigh = Mathf.Lerp(config1.GradHigh, config2.GradHigh, t), BloomFactor = Mathf.Lerp(config1.BloomFactor, config2.BloomFactor, t) }); }