private void Update() { this.Length = this.MaxCastDistance; this._showEnd = false; PlayerInventory.PlayerViews currentView = LocalPlayer.CurrentView; switch (currentView) { case PlayerInventory.PlayerViews.Loading: case PlayerInventory.PlayerViews.Inventory: break; default: if (currentView != PlayerInventory.PlayerViews.Pause) { if (LocalPlayer.Create) { this.DoCreateUpdate(); } goto IL_60; } break; } this.DoInventoryAndMenusUpdate(); IL_60: this.UpdateLaser(); this.UpdateEnd(); this.UpdateLayer(); }
private void SetIconHolderTr(Transform t, ActionIconSystem.CurrentViewOptions currentViewOption) { switch (currentViewOption) { case ActionIconSystem.CurrentViewOptions.AllowInWorld: this.SetParentAndLayer(t, this._iconHolderTr); break; case ActionIconSystem.CurrentViewOptions.AllowInBook: this.SetParentAndLayer(t, this._iconHolderBookTr); break; case ActionIconSystem.CurrentViewOptions.AllowInPlane: case ActionIconSystem.CurrentViewOptions.DeathScreen: this.SetParentAndLayer(t, this._iconHolderPlaneTr); break; case ActionIconSystem.CurrentViewOptions.AllowInInventory: this.SetParentAndLayer(t, this._iconHolderInventoryTr); break; case ActionIconSystem.CurrentViewOptions.HudIcon: if (LocalPlayer.Inventory) { PlayerInventory.PlayerViews currentView = LocalPlayer.Inventory.CurrentView; switch (currentView) { case PlayerInventory.PlayerViews.Inventory: this.SetParentAndLayer(t, this._iconHolderInventoryTr); break; default: if (currentView != PlayerInventory.PlayerViews.PlaneCrash) { this.SetParentAndLayer(t, this._iconHolderTr); } else { this.SetParentAndLayer(t, this._iconHolderPlaneHudTr); } break; case PlayerInventory.PlayerViews.Book: this.SetParentAndLayer(t, this._iconHolderBookTr); break; case PlayerInventory.PlayerViews.Pause: this.SetParentAndLayer(t, this._iconHolderPauseTr); break; } } else { t.parent = base.transform; } break; } }
private void Update() { if (this._entity && this._entity.isAttached) { PlayerInventory.PlayerViews currentView = (PlayerInventory.PlayerViews) this._entity.GetState <IPlayerState>().CurrentView; this._overlay._bookIcon.enabled = (currentView == PlayerInventory.PlayerViews.Book); this._overlay._inventoryIcon.enabled = (currentView == PlayerInventory.PlayerViews.Inventory); this._overlay._menuIcon.enabled = (currentView == PlayerInventory.PlayerViews.Pause); this._overlay._deathIcon.enabled = (currentView == PlayerInventory.PlayerViews.Death); this._overlay._sleepIcon.enabled = (currentView == PlayerInventory.PlayerViews.Sleep); } }
public void OnCurrentViewChanged() { if (this._playerState == null) { return; } PlayerInventory.PlayerViews currentView = (PlayerInventory.PlayerViews) this._playerState.CurrentView; this._overlay._bookIcon.enabled = (PlayerPreferences.ShowPlayerNamesMP && currentView == PlayerInventory.PlayerViews.Book); this._overlay._inventoryIcon.enabled = (PlayerPreferences.ShowPlayerNamesMP && currentView == PlayerInventory.PlayerViews.Inventory); this._overlay._menuIcon.enabled = (PlayerPreferences.ShowPlayerNamesMP && currentView == PlayerInventory.PlayerViews.Pause); this._overlay._deathIcon.enabled = (PlayerPreferences.ShowPlayerNamesMP && currentView == PlayerInventory.PlayerViews.Death); this._overlay._sleepIcon.enabled = (PlayerPreferences.ShowPlayerNamesMP && currentView == PlayerInventory.PlayerViews.Sleep); }
public static void UpdateControlMapping() { if (Input.player == null) { return; } if (LocalPlayer.Inventory == null) { return; } PlayerInventory.PlayerViews currentView = LocalPlayer.Inventory.CurrentView; if (currentView != PlayerInventory.PlayerViews.Pause) { Input.SetMenuMapping(false); } else { Input.SetMenuMapping(true); } }
private void Update() { if (LocalPlayer.Stats) { this.playerIsInSnowArea = LocalPlayer.Stats.IsInNorthColdArea(); } Shader.SetGlobalColor("_AmbientSkyColor", RenderSettings.ambientSkyColor.linear * RenderSettings.ambientIntensity); bool flag = false; if (!CoopPeerStarter.DedicatedHost && LocalPlayer.Transform) { bool flag2 = false; if (Scene.SceneTracker.caveEntrances.Count > 0 && LocalPlayer.IsInCaves && !LocalPlayer.IsInEndgame) { for (int i = Scene.SceneTracker.caveEntrances.Count - 1; i >= 0; i--) { if (Scene.SceneTracker.caveEntrances[i] != null && (LocalPlayer.Transform.position - Scene.SceneTracker.caveEntrances[i].transform.position).sqrMagnitude < 2500f) { flag2 = true; } } if (!flag2) { flag = true; } } } if (flag) { if (this.Sun.gameObject.activeSelf) { this.Sun.gameObject.SetActive(false); } if (this.Moon.gameObject.activeSelf) { this.Moon.gameObject.SetActive(false); } } else { if (!this.Sun.gameObject.activeSelf) { this.Sun.gameObject.SetActive(true); } if (!this.Moon.gameObject.activeSelf) { this.Moon.gameObject.SetActive(true); } } this.Randomize(false); this.caveAmt = Mathf.Lerp(this.caveAmt, (!LocalPlayer.IsInClosedArea) ? 0f : 1f, Time.deltaTime); Shader.SetGlobalFloat("CaveAmount", this.caveAmt); Shader.SetGlobalFloat("_ForestCaveSetting", Mathf.Lerp(1f, -1f, this.caveAmt)); if (this.MoonLightIntensity < this.MoonBrightness) { this.MoonLightIntensity += 0.01f * Time.deltaTime; } else if (this.MoonLightIntensity > this.MoonBrightness) { this.MoonLightIntensity -= 0.01f * Time.deltaTime; } if (LocalPlayer.IsInOutsideWorld) { if (LocalPlayer.IsInOverlookArea) { this.FogMinHeight = this.OceanH.position.y + 1450f; this.Visibility = this.ForCurrentScaled; } else { this.FogMinHeight = this.OceanH.position.y; } } bool flag3 = LocalPlayer.AnimControl != null && LocalPlayer.AnimControl.endGameCutScene; bool flag4 = LocalPlayer.AnimControl != null && LocalPlayer.AnimControl.exitingACave; if (Application.isPlaying && !this.overrideVisibility && (CoopPeerStarter.DedicatedHost || !flag3)) { if (this.Visibility < this.ForCurrentScaled) { this.Visibility += 1f; } else if (this.Visibility > this.ForCurrentScaled) { this.Visibility -= 1f; } } if (Application.isPlaying && (CoopPeerStarter.DedicatedHost || LocalPlayer.IsInClosedArea || flag4)) { float b = this.CaveAmbientIntensity; float b2 = 0f; float b3 = 0f; Color b4 = Color.black; Color b5 = this.CaveSkyColor; Color b6 = this.CaveEquatorColor; Color b7 = this.CaveGroundColor; Color b8 = this.CaveAddLight1; Vector3 b9 = this.CaveAddLight1Dir; Color b10 = this.CaveAddLight2; Vector3 b11 = this.CaveAddLight2Dir; if (Application.isPlaying && !CoopPeerStarter.DedicatedHost && flag4) { if (this.isDaytime()) { b = Mathf.Lerp(this.SunsetAmbientIntensity, this.DayAmbientIntensity, this.LdotUp); b2 = Mathf.Lerp(this.SunsetSunIntensity, this.DaySunIntensity, this.LdotUp); b3 = Mathf.Lerp(this.SunsetSunBounceIntensity, this.DaySunBounceIntensity, this.LdotUp); b4 = Color.Lerp(this.SunsetBounceColor * this.SunsetSunBounceIntensity, this.DayBounceColor * this.DaySunBounceIntensity, this.LdotUp); b5 = Color.Lerp(this.SunsetColor * this.SunsetAmbientIntensity, this.DayColor * this.DayAmbientIntensity, this.LdotUp); b6 = Color.Lerp(this.SunsetColorEq * this.SunsetAmbientIntensity, this.DayColorEq * this.DayAmbientIntensity, this.LdotUp); b7 = Color.Lerp(this.SunsetColorGround * this.SunsetAmbientIntensity, this.DayColorGround * this.DayAmbientIntensity, this.LdotUp); b8 = Color.Lerp(this.SunsetAddLight1, this.NoonAddLight1, this.LdotUp); b9 = Vector3.Lerp(this.SunsetAddLight1Dir, this.NoonAddLight1Dir, this.LdotUp); b10 = Color.Lerp(this.SunsetAddLight2, this.NoonAddLight2, this.LdotUp); b11 = Vector3.Lerp(this.SunsetAddLight2Dir, this.NoonAddLight2Dir, this.LdotUp); } else { b = Mathf.Lerp(this.SunsetAmbientIntensity, this.NightAmbientIntensity, this.LdotDown); b2 = Mathf.Lerp(this.SunsetSunIntensity, this.NightSunIntensity, this.LdotDown); b3 = Mathf.Lerp(this.SunsetSunBounceIntensity, this.NightSunBounceIntensity, this.LdotDown); b4 = Color.Lerp(this.SunsetBounceColor * this.SunsetSunBounceIntensity, this.NightBounceColor * this.NightSunBounceIntensity, this.LdotDown); b5 = Color.Lerp(this.SunsetColor * this.SunsetAmbientIntensity, this.NightColor * this.NightAmbientIntensity, this.LdotDown); b6 = Color.Lerp(this.SunsetColorEq * this.SunsetAmbientIntensity, this.NightColorEq * this.NightAmbientIntensity, this.LdotDown); b7 = Color.Lerp(this.SunsetColorGround * this.SunsetAmbientIntensity, this.NightColorGround * this.NightAmbientIntensity, this.LdotDown); b8 = Color.Lerp(this.SunsetAddLight1, this.NightAddLight1, this.LdotDown); b9 = Vector3.Lerp(this.SunsetAddLight1Dir, this.NightAddLight1Dir, this.LdotDown); b10 = Color.Lerp(this.SunsetAddLight2, this.NightAddLight2, this.LdotDown); b11 = Vector3.Lerp(this.SunsetAddLight2Dir, this.NightAddLight2Dir, this.LdotDown); } } TheForestAtmosphere.ReflectionAmount = 0.2f; float num = 0.5f; if (Application.isPlaying && !CoopPeerStarter.DedicatedHost && flag4) { num = 1f; } this.temp_AmbientIntensity = Mathf.Lerp(this.SunsetAmbientIntensity, b, Time.deltaTime * num); this.temp_SunIntensity = Mathf.Lerp(this.temp_SunIntensity, b2, Time.deltaTime * num); this.temp_SunBounceIntensity = Mathf.Lerp(this.temp_SunBounceIntensity, b3, Time.deltaTime * num); this.temp_BounceColor = Color.Lerp(this.temp_BounceColor, b4, Time.deltaTime * num); this.temp_SkyColor = Color.Lerp(this.temp_SkyColor, b5, Time.deltaTime * num); this.temp_EquatorColor = Color.Lerp(this.temp_EquatorColor, b6, Time.deltaTime * num); this.temp_GroundColor = Color.Lerp(this.temp_GroundColor, b7, Time.deltaTime * num); this.temp_AddLight1 = Color.Lerp(this.SunsetAddLight1, b8, Time.deltaTime * num); this.temp_AddLight1Dir = Vector3.Lerp(this.SunsetAddLight1Dir, b9, Time.deltaTime * num); this.temp_AddLight2 = Color.Lerp(this.SunsetAddLight2, b10, Time.deltaTime * num); this.temp_AddLight2Dir = Vector3.Lerp(this.SunsetAddLight2Dir, b11, Time.deltaTime * num); this.SetSHAmbientLighting(); } if (this.Sun == null) { Debug.Log("Set the main light"); } else { this.L = -this.Sun.transform.forward; DistanceCloud.sunlightVector = this.L; this.LdotUp = Mathf.Clamp01(Vector3.Dot(this.L, Vector3.up)); this.LdotDown = Mathf.Clamp01(Vector3.Dot(this.L, Vector3.down)); float num2 = Mathf.Cos(this.dayNightTransitionAngle * 0.0174532924f); float num3 = 1f / (1f - num2); float num4 = Mathf.Clamp01((this.LdotUp - num2) * num3); float num5 = 1f - Mathf.Pow(1f - num4, 4f); Color color = Color.Lerp(this.CurrentSunsetLightColor, this.NoonLightColor, num5); if (num5 <= 0f) { float num6 = Mathf.Abs(this.LdotUp - num2) * (1f / num2); float t = Mathf.Clamp01(num6 * 1.5f); color = Color.Lerp(this.CurrentSunsetLightColor, this.Moon.color, t); } color.r = Mathf.Pow(color.r, 1f); color.g = Mathf.Pow(color.g, 1f); color.b = Mathf.Pow(color.b, 1f); this.Sun.color = color; this.FogColor = Color.Lerp(Color.Lerp(new Color(0f, 0f, 0f, 0f), this.GetNoonFogColor, Mathf.Clamp01(this.LdotUp)), new Color(0f, 0f, 0f, 0f), Mathf.Clamp01(this.LdotDown)); if (Sunshine.Instance.Ready) { Sunshine.Instance.ScatterColor = this.FogColor; } if (LocalPlayer.IsInClosedArea || this.overrideVisibility) { this.FogColor = new Color(0f, 0f, 0f, 0f); } this.CurrentFogColor = this.FogColor; this.Vanishing = Mathf.Lerp(Mathf.Lerp(0f, 1f, Mathf.Clamp01(10f * this.LdotUp)), 1f, Mathf.Clamp01(10f * this.LdotDown)); if (Sunshine.Instance.Ready) { Sunshine.Instance.PostScatterMaterial.SetFloat("Vanishing", this.Vanishing); } this.sunE = 10000f * Mathf.Max(0f, 1f - Mathf.Exp(-((this.cutoffAngle - Mathf.Acos(this.LdotUp)) / this.steepness))); if (this.Animate && !BoltNetwork.isClient) { if (!SteamDSConfig.isDedicatedServer || Scene.SceneTracker.allPlayerEntities.Count != 0) { float num7 = Time.deltaTime * this.RotationSpeed * TheForestAtmosphere.GameTimeScale; if (this.Sleeping) { this.TimeOfDay += num7 * 600f; this.DeltaTimeOfDay = (double)(num7 * 600f / 360f); } else if (this.Moon.enabled) { this.TimeOfDay += num7 * 2f; this.DeltaTimeOfDay = (double)(num7 * 2f / 360f); } else { this.TimeOfDay += num7; this.DeltaTimeOfDay = (double)(num7 / 360f); } this.TimeOfDay %= 360f; FMOD_StudioEventEmitter.HoursSinceMidnight = (this.TimeOfDay + 180f) % 360f * 0.06666667f; } else { this.DeltaTimeOfDay = 0.0; } } PlayerInventory.PlayerViews playerViews = (!LocalPlayer.Inventory.IsNull()) ? LocalPlayer.Inventory.CurrentView : PlayerInventory.PlayerViews.Loading; bool flag5 = LocalPlayer.Inventory.IsNull() || this.Sleeping || (!LocalPlayer.Inventory.enabled && !ChatBox.IsChatOpen) || playerViews < PlayerInventory.PlayerViews.World || (playerViews > PlayerInventory.PlayerViews.Inventory && playerViews < PlayerInventory.PlayerViews.Sleep && playerViews != PlayerInventory.PlayerViews.Book); bool flag6 = LocalPlayer.MainCamTr.IsNull() || Vector3.Distance(LocalPlayer.MainCamTr.forward, this.PrevCameraForward) > 0.01f; bool flag7 = LocalPlayer.Rigidbody.IsNull() || LocalPlayer.Rigidbody.velocity.sqrMagnitude > 0.5f || ChatBox.IsChatOpen || playerViews == PlayerInventory.PlayerViews.Book; if (this.TimeOfDay > 70f && this.TimeOfDay < 280f) { this.CatchUpTimeOfDay = true; } if (BoltNetwork.isClient && playerViews >= PlayerInventory.PlayerViews.Loading && (!CoopWeatherProxy.Instance || !CoopWeatherProxy.Instance.enabled)) { this.TimeOfDay = CoopWeatherProxy.JoiningTimeOfDay; this.ForceSunRotationUpdate = true; } float num8; if (this.LdotUp < 0.5f) { num8 = Mathf.Clamp(this.DayCloudAlphaValue * this.LdotUp, this.NightCloudAlphaValue, 1f); } else { num8 = this.DayCloudAlphaValue; } if (Application.isPlaying && Scene.WeatherSystem.vClouds && !Mathf.Approximately(num8, Scene.WeatherSystem.vClouds.materialUsed.GetColor("_ShadowColor").a)) { this.smoothTargetCloudAlpha = Mathf.Lerp(this.smoothTargetCloudAlpha, num8, Time.deltaTime * 0.2f); Color color2 = Scene.WeatherSystem.vClouds.materialUsed.GetColor("_ShadowColor"); color2.a = this.smoothTargetCloudAlpha; Scene.WeatherSystem.vClouds.materialUsed.SetColor("_ShadowColor", color2); } float num9 = this.TimeOfDay; if (LocalPlayer.IsInOverlookArea) { num9 = 20f; this.ForceSunRotationUpdate = true; } if (this.OverrideLightingTimeOfDay) { num9 = this.LightingTimeOfDayOverrideValue; this.ForceSunRotationUpdate = true; } if (flag5 || this.ForceSunRotationUpdate || Clock.Dark) { this.DelayedTimeOfDayAlpha = 1f; this.DelayedTimeOfDay = num9; this.Sun.transform.rotation = this.SunRotationAtTimeOfDay(this.DelayedTimeOfDay); this.ForceSunRotationUpdate = false; this.CatchUpTimeOfDay = false; } else if (this.CatchUpTimeOfDay) { if (this.DelayedTimeOfDayAlpha < 0f) { this.DelayedTimeOfDayAlpha = 0f; this.MovementStartTimeOfDay = this.DelayedTimeOfDay; } this.DelayedTimeOfDayAlpha = Mathf.Clamp01(this.DelayedTimeOfDayAlpha + Time.deltaTime / 5f); float num10 = MathEx.Easing.EaseInOutQuad(this.DelayedTimeOfDayAlpha, 0f, 1f, 1f); if (num10 >= 1f) { num10 = 1f; this.CatchUpTimeOfDay = false; } this.DelayedTimeOfDay = this.LerpToTimeOfDay(this.MovementStartTimeOfDay, num9, num10); this.Sun.transform.rotation = this.SunRotationAtTimeOfDay(this.DelayedTimeOfDay); } else if (flag7 || flag6) { if (this.DelayedTimeOfDayAlpha < 0f) { this.DelayedTimeOfDayAlpha = 0f; this.MovementStartTimeOfDay = this.DelayedTimeOfDay; } this.DelayedTimeOfDayAlpha = Mathf.Clamp01(this.DelayedTimeOfDayAlpha + Time.deltaTime / 5f); float alpha = MathEx.Easing.EaseInQuad(this.DelayedTimeOfDayAlpha, 0f, 1f, 1f); this.DelayedTimeOfDay = this.LerpToTimeOfDay(this.MovementStartTimeOfDay, num9, alpha); this.Sun.transform.rotation = this.SunRotationAtTimeOfDay(this.DelayedTimeOfDay); if (flag6 && !LocalPlayer.MainCamTr.IsNull()) { this.PrevCameraForward = LocalPlayer.MainCamTr.forward; } } else { this.DelayedTimeOfDayAlpha = -1f; float num11; if (this.DelayedTimeOfDay <= num9) { num11 = num9 - this.DelayedTimeOfDay; } else { num11 = (num9 + 360f - this.DelayedTimeOfDay) % 360f; } if (num11 > 5f) { this.CatchUpTimeOfDay = true; } } if (this.Sleeping) { this.ForceSunRotationUpdate = true; } } if (this.Moon == null) { Debug.Log("Set the moon"); } else { this.Moon.transform.rotation = Quaternion.Euler(new Vector3(this.Lx - 180f, this.Ly, 0f)) * Quaternion.Euler(0f, -this.TimeOfDay, 0f); } if (Application.isPlaying) { Vector3 vector = (!Clock.Dark) ? Scene.Atmosphere.Sun.transform.forward : Scene.Atmosphere.Moon.transform.forward; vector.y = 0f; float num12 = 1f + (LOD_Manager.TreeOcclusionBonusRatio - 1f) * this.OCCLUSION_MULT; num12 = Mathf.Clamp(num12, 1f, 4f); float num13 = LOD_Manager.Instance.Trees.BaseRanges[2] + this.SHADOW_BASE_DISTANCE; int num14 = Mathf.FloorToInt(num13 * num12); if (this.startShadowCoolDown < 5f) { this.startShadowCoolDown += Time.deltaTime; num14 = 300; } switch (TheForestQualitySettings.UserSettings.ShadowLevel) { case TheForestQualitySettings.ShadowLevels.VeryHigh: num14 = num14; goto IL_12C3; case TheForestQualitySettings.ShadowLevels.High: num14 = num14; goto IL_12C3; case TheForestQualitySettings.ShadowLevels.Medium: num14 = num14; goto IL_12C3; case TheForestQualitySettings.ShadowLevels.Low: num14 = 130; goto IL_12C3; case TheForestQualitySettings.ShadowLevels.Fastest: num14 = 100; goto IL_12C3; } num14 = 60; IL_12C3: if (this.LowerShadowsAtExtremeLightAngles) { QualitySettings.shadowDistance = Mathf.Lerp(1f, 0.35f, (vector.magnitude - 0.9f) * 10f) * (float)num14; } else { QualitySettings.shadowDistance = (float)num14; } this.DebugShadowDist = QualitySettings.shadowDistance; } if (this.isDaytime()) { if (!this.Sun.enabled) { this.Sun.color = this.Moon.color; this.Sun.enabled = true; this.Moon.enabled = false; this.afs.DirectionalLightReference = this.Sun.gameObject; } if (LocalPlayer.IsInOutsideWorld) { TheForestAtmosphere.Ambient = Color.Lerp(this.SunsetColor, this.DayColor, this.LdotUp); TheForestAtmosphere.AmbientSheen = Color.Lerp(this.SunsetColor, this.DayColor, this.LdotUp); this.Sun.intensity = (TheForestAtmosphere.ReflectionAmount = this.SunLightIntensity * Mathf.Clamp01((1f - Mathf.Pow(1f - this.LdotUp, 2f)) * 1.1f - 0.1f) * 0.5f); if (Scene.WeatherSystem) { this.Sun.intensity *= Mathf.Lerp(1f, 0.625f, Scene.WeatherSystem.CloudCovergage); } this.atmosphereGain = 1f; if (Application.isPlaying && !CoopPeerStarter.DedicatedHost && !flag4) { this.temp_AmbientIntensity = Mathf.Lerp(this.SunsetAmbientIntensity, this.DayAmbientIntensity, this.LdotUp); this.temp_SunIntensity = Mathf.Lerp(this.SunsetSunIntensity, this.DaySunIntensity, this.LdotUp); this.temp_SunBounceIntensity = Mathf.Lerp(this.SunsetSunBounceIntensity, this.DaySunBounceIntensity, this.LdotUp); this.temp_BounceColor = Color.Lerp(this.SunsetBounceColor * this.SunsetSunBounceIntensity, this.DayBounceColor * this.DaySunBounceIntensity, this.LdotUp); this.temp_SkyColor = Color.Lerp(this.SunsetColor * this.SunsetAmbientIntensity, this.DayColor * this.DayAmbientIntensity, this.LdotUp); this.temp_EquatorColor = Color.Lerp(this.SunsetColorEq * this.SunsetAmbientIntensity, this.DayColorEq * this.DayAmbientIntensity, this.LdotUp); this.temp_GroundColor = Color.Lerp(this.SunsetColorGround * this.SunsetAmbientIntensity, this.DayColorGround * this.DayAmbientIntensity, this.LdotUp); this.temp_AddLight1 = Color.Lerp(this.SunsetAddLight1, this.NoonAddLight1, this.LdotUp); this.temp_AddLight1Dir = Vector3.Lerp(this.SunsetAddLight1Dir, this.NoonAddLight1Dir, this.LdotUp); this.temp_AddLight2 = Color.Lerp(this.SunsetAddLight2, this.NoonAddLight2, this.LdotUp); this.temp_AddLight2Dir = Vector3.Lerp(this.SunsetAddLight2Dir, this.NoonAddLight2Dir, this.LdotUp); this.SetSHAmbientLighting(); } } else { TheForestAtmosphere.AmbientSheen = Color.black; } Sunshine.Instance.SunLight = this.Sun; if (Sunshine.Instance.Ready) { this.InscatteringMaterial.SetVector("L", this.L); Sunshine.Instance.PostScatterMaterial.SetVector("InscatteringColor", this.Sun.color * this.Sun.intensity); Shader.SetGlobalVector("_LightVecL", this.L); Shader.SetGlobalVector("_InscatteringColor", this.Sun.color * this.Sun.intensity); } } else { if (!this.Moon.enabled) { this.Moon.enabled = true; this.afs.DirectionalLightReference = this.Moon.gameObject; this.Sun.enabled = false; } Sunshine.Instance.SunLight = this.Moon; if (!CoopPeerStarter.DedicatedHost && LocalPlayer.IsInOutsideWorld) { this.Moon.intensity = this.MoonLightIntensity * (1f - Mathf.Pow(1f - this.LdotDown, 2f)); this.atmosphereGain = Mathf.Lerp(1f, 0.01f, Mathf.Clamp01(15f * this.LdotDown)); TheForestAtmosphere.ReflectionAmount = this.Moon.intensity / 3f; TheForestAtmosphere.Ambient = Color.Lerp(this.SunsetColor, this.NightColor, this.LdotDown); TheForestAtmosphere.AmbientSheen = Color.Lerp(this.SunsetColor, this.NightColor, this.LdotDown); if (Application.isPlaying && !flag4) { this.temp_AmbientIntensity = Mathf.Lerp(this.SunsetAmbientIntensity, this.NightAmbientIntensity, this.LdotDown); this.temp_SunIntensity = Mathf.Lerp(this.SunsetSunIntensity, this.NightSunIntensity, this.LdotDown); this.temp_SunBounceIntensity = Mathf.Lerp(this.SunsetSunBounceIntensity, this.NightSunBounceIntensity, this.LdotDown); this.temp_BounceColor = Color.Lerp(this.SunsetBounceColor * this.SunsetSunBounceIntensity, this.NightBounceColor * this.NightSunBounceIntensity, this.LdotDown); this.temp_SkyColor = Color.Lerp(this.SunsetColor * this.SunsetAmbientIntensity, this.NightColor * this.NightAmbientIntensity, this.LdotDown); this.temp_EquatorColor = Color.Lerp(this.SunsetColorEq * this.SunsetAmbientIntensity, this.NightColorEq * this.NightAmbientIntensity, this.LdotDown); this.temp_GroundColor = Color.Lerp(this.SunsetColorGround * this.SunsetAmbientIntensity, this.NightColorGround * this.NightAmbientIntensity, this.LdotDown); this.temp_AddLight1 = Color.Lerp(this.SunsetAddLight1, this.NightAddLight1, this.LdotDown); this.temp_AddLight1Dir = Vector3.Lerp(this.SunsetAddLight1Dir, this.NightAddLight1Dir, this.LdotDown); this.temp_AddLight2 = Color.Lerp(this.SunsetAddLight2, this.NightAddLight2, this.LdotDown); this.temp_AddLight2Dir = Vector3.Lerp(this.SunsetAddLight2Dir, this.NightAddLight2Dir, this.LdotDown); this.SetSHAmbientLighting(); } } else { TheForestAtmosphere.AmbientSheen = Color.black; } if (Sunshine.Instance.Ready) { this.InscatteringMaterial.SetVector("L", -this.L); Sunshine.Instance.PostScatterMaterial.SetVector("InscatteringColor", this.Moon.color * this.Moon.intensity / 2f); Shader.SetGlobalVector("_LightVecL", -this.L); Shader.SetGlobalVector("_InscatteringColor", this.Moon.color * this.Moon.intensity / 2f); } } Shader.SetGlobalColor("_FogColor", this.CurrentFogColor); this.UpdateWind(); }