Files
2026-03-04 10:03:45 +08:00

1185 lines
43 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace Artngame.SKYMASTER
{
[ExecuteInEditMode]
public class controlWeatherTOD_SM_SRP : MonoBehaviour
{
[Header("------------------------------------------------------")]
[Header("Script Setup - Lightning Control")]
[Header("------------------------------------------------------")]
public bool activateGUI = true;
public bool enableGUI;
public Transform water;
public PlanarReflectionSM reflection;
public TerrainDepthSM depthRenderer;
public CloudHandlerSM shaderVolClouds;
public bool forceLightning;
public lightningCameraVolumeCloudsSM_SRP lightningController;
public SkyMasterManager skyManager;
public CloudScript fullVolumeClouds;
public CloudScript fullVolumeCloudsREFL;
public GlobalFogSkyMaster etherealVolFog;
public WaterHandlerSM waterManager;
[Header("------------------------------------------------------")]
[Header("Cloud Density - Color Controls")]
[Header("------------------------------------------------------")]
public bool affectCloudDensity = true;
public bool affectCloudColor = true;
public bool affectCloudTopColor;
public List<float> weatherCloudDensities = new List<float>();
public float densitiesOffset;
public float densityThicknessOffset;
public bool ApplyPresetDensities = true;
public int cloudType;
public GameObject temporalSunMoon;
public float cloudTransitionSpeed = 1f;
public Color cloudColor;
public Color cloudsAmbientColor;
public float cloudColorSpeed = 1f;
public float cloudColorSpeedD = 1f;
public float cloudColorSpeedN = 1f;
public Color Day_Sun_Color = new Color(0.933f, 0.933f, 0.933f, 1f);
public Color Day_Ambient_Color = new Color(0.4f, 0.4f, 0.4f, 1f);
public Color Day_Tint_Color = new Color(0.2f, 0.2f, 0.2f, 1f);
public Color Dusk_Sun_Color = new Color(0.933f, 0.596f, 0.443f, 1f);
public Color Dusk_Ambient_Color = new Color(0.2f, 0.2f, 0.2f, 0f);
public Color Dusk_Tint_Color = new Color(0.386f, 0f, 0f, 0f);
public Color Dawn_Sun_Color = new Color(0.933f, 0.933f, 0.933f, 1f);
public Color Dawn_Ambient_Color = new Color(0.35f, 0.35f, 0.35f, 1f);
public Color Dawn_Tint_Color = new Color(0.2f, 0.05f, 0.1f, 0f);
public Color Night_Sun_Color = new Color(0.01f, 0.01f, 0.01f, 1f);
public Color Night_Ambient_Color = new Color(0.03f, 0.03f, 0.03f, 0f);
public Color Night_Tint_Color = new Color(0f, 0f, 0f, 0f);
public Color cloudStormColor = new Color(0.13f, 0.12f, 0.11f, 0f);
public Color cloudStormAmbientColor = new Color(0.13f, 0.12f, 0.11f, 0f);
[HideInInspector]
public Vector2 heigthNoiseDensities = new Vector2(0f, 0f);
[HideInInspector]
public float clearskyFactor = 0.43f;
[HideInInspector]
public float noiseSpeed;
[HideInInspector]
public float volumeFogHeight;
[HideInInspector]
public float volumeNoiseScale;
[HideInInspector]
public float volumeFogDensity;
[HideInInspector]
public float volumeLightPower = 1f;
[HideInInspector]
public float volumeFogPower = 1f;
[HideInInspector]
public float volumeFogNoise;
[HideInInspector]
public float volumeFogNoisePower = 1f;
[HideInInspector]
public Color volumeFogColor = Color.white * 0.15f;
[HideInInspector]
public Vector4 lightNoiseControl = new Vector4(1f, 1f, 1f, 1f);
[Header("------------------------------------------------------")]
[Header("Eclipse System")]
[Header("------------------------------------------------------")]
[Tooltip("Active eclipse system")]
public bool useEclipseSystem;
[Tooltip("Lerp to eclipse, if deactivated lerp back to previous state")]
public bool activateEclipse;
public bool eclipseByAngle;
[Tooltip("Enable eclipse transition in editor. Advanced option, use with caution, preferably edit eclipse in play mode and pass the settings to editor.")]
public bool eclipseInEditor;
public float fExposureOffsetS;
public Vector3 fWaveLengthOffsetS = Vector3.zero;
public float gOffsetS;
public float scaleDifOffsetS;
public Vector3 tintColorOffsetS = Vector3.zero;
public float sunRingFactorOffsetS;
public float Sun_halo_factorS;
public float Sun_eclipse_factorS;
public float Glob_scaleS = 1f;
public bool eclipseActivated;
public bool passSettingsToEclipse;
public float eclipseSpeed = 1f;
[Header("------------------------------------------------------")]
[Header("Sky Parameters")]
[Header("------------------------------------------------------")]
[Tooltip("Offset sky Gradient coloration and curve controls")]
public bool advancedSkyOffsets;
[Tooltip("Choose sky style Preset (1-11), choose 12 to enable Advanced Sky Options below")]
public int skyPreset = 9;
public float fExposureOffset;
public Vector3 fWaveLengthOffset = Vector3.zero;
public float gOffset;
public float scaleDifOffset;
public Vector3 tintColorOffset = Vector3.zero;
public float sunRingFactorOffset;
public float Sun_halo_factor;
public float Sun_eclipse_factor;
public float Glob_scale = 1f;
public bool advancedSkyOptions;
[Tooltip("Advanced Sky Options below")]
public float Esun = 0.66f;
public float Kr = 0.005510659f;
public float Km = 0.0004f;
public float fsamples = 0.02f;
public float fRayleightScaleDepth = 0.06f;
public float coloration = -0.04399999f;
[Header("------------------------------------------------------")]
[Header("Moon Controls")]
[Header("------------------------------------------------------")]
[Tooltip("Manually control moon lighting")]
public bool controlMoonPhase;
[Tooltip("Moon lighting left-right (X), up-down (Y), front-back (Z)")]
public Vector3 moonLightDirection = Vector3.one * 50000f;
public Color MoonSunLight = new Color(0f, 0f, 0f, 1f);
public Color MoonAmbientLight = new Color(0f, 0f, 0f, 1f);
public Color MoonSunLightS = new Color(0f, 0f, 0f, 1f);
public Color MoonAmbientLightS = new Color(0f, 0f, 0f, 1f);
public bool tintMoonBySkyGrad;
public Color MoonSkyLight = new Color(0f, 0f, 0f, 0f);
public Color MoonSkyLightS = new Color(0f, 0f, 0f, 0f);
public Material MoonA;
public Material MoonB;
[Tooltip("enable the automatic moon shading based on the sun postion with AutoMoonLighting option")]
public bool autoMoonPhase;
private void Start()
{
if (temporalSunMoon == null)
{
temporalSunMoon = new GameObject();
temporalSunMoon.name = "SunMoonTransformLerp";
temporalSunMoon.transform.rotation = skyManager.SUN_LIGHT.transform.rotation;
temporalSunMoon.transform.position = skyManager.SUN_LIGHT.transform.position;
temporalSunMoon.AddComponent<Light>();
_ = fullVolumeClouds.sunLight;
fullVolumeClouds.sunLight = temporalSunMoon.GetComponent<Light>();
if (fullVolumeCloudsREFL != null)
{
fullVolumeCloudsREFL.sunLight = temporalSunMoon.GetComponent<Light>();
}
}
else
{
temporalSunMoon.transform.rotation = skyManager.SUN_LIGHT.transform.rotation;
temporalSunMoon.transform.position = skyManager.SUN_LIGHT.transform.position;
}
if (affectCloudDensity && fullVolumeClouds != null)
{
setFullVolumeCloudsDensity(lerp: false);
if (fullVolumeCloudsREFL != null)
{
fullVolumeCloudsREFL.density = fullVolumeClouds.density;
fullVolumeCloudsREFL.coverage = fullVolumeClouds.coverage;
fullVolumeCloudsREFL.scale = fullVolumeClouds.scale;
fullVolumeCloudsREFL.detailScale = fullVolumeClouds.detailScale;
fullVolumeCloudsREFL.lowFreqMin = fullVolumeClouds.lowFreqMin;
fullVolumeCloudsREFL.lowFreqMax = fullVolumeClouds.lowFreqMax;
fullVolumeCloudsREFL.highFreqModifier = fullVolumeClouds.highFreqModifier;
fullVolumeCloudsREFL.weatherScale = fullVolumeClouds.weatherScale;
fullVolumeCloudsREFL.startHeight = fullVolumeClouds.startHeight;
fullVolumeCloudsREFL.thickness = fullVolumeClouds.thickness;
fullVolumeCloudsREFL.planetSize = fullVolumeClouds.planetSize;
fullVolumeCloudsREFL.cloudSampleMultiplier = fullVolumeClouds.cloudSampleMultiplier;
fullVolumeCloudsREFL.globalMultiplier = fullVolumeClouds.globalMultiplier;
fullVolumeCloudsREFL.windSpeed = fullVolumeClouds.windSpeed;
fullVolumeCloudsREFL.windDirection = fullVolumeClouds.windDirection;
fullVolumeCloudsREFL.coverageWindSpeed = fullVolumeClouds.coverageWindSpeed;
fullVolumeCloudsREFL.coverageWindDirection = fullVolumeClouds.coverageWindDirection;
}
}
if (affectCloudColor && fullVolumeClouds != null)
{
setFullVolumeCloudsColors();
if (fullVolumeCloudsREFL != null)
{
fullVolumeCloudsREFL.highSunColor = fullVolumeClouds.highSunColor;
fullVolumeCloudsREFL.cloudBaseColor = fullVolumeClouds.cloudBaseColor;
fullVolumeCloudsREFL._SkyTint = fullVolumeClouds._SkyTint;
if (affectCloudTopColor)
{
fullVolumeCloudsREFL.cloudTopColor = fullVolumeClouds.cloudTopColor;
}
}
}
if (skyManager.skyboxMat != null)
{
if ((!skyManager.AutoSunPosition && ((skyManager.Current_Time >= 9f + skyManager.Shift_dawn) & (skyManager.Current_Time <= skyManager.NightTimeMax + skyManager.Shift_dawn))) | (skyManager.AutoSunPosition && skyManager.Rot_Sun_X > 0f))
{
if (skyManager.Current_Time < 1f)
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.y));
}
else
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.y));
}
}
else if (skyManager.Current_Time < 1f)
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.x));
}
else
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.x));
}
skyManager.skyboxMat.SetFloat("_Light", skyManager.StarsIntensity);
}
if (activateGUI && enableGUI)
{
_ = Application.isPlaying;
}
}
public void OnGUI()
{
if (!activateGUI)
{
return;
}
if (GUI.Button(new Rect(10f, 40f, 100f, 30f), "GUI Toggle"))
{
if (enableGUI)
{
enableGUI = false;
}
else
{
enableGUI = true;
}
}
if (enableGUI && Application.isPlaying)
{
if (GUI.Button(new Rect(10f, 10f, 100f, 30f), "Dust Storm"))
{
volumeLightPower = 0.65f;
volumeFogNoise = 0.1f;
volumeFogHeight = 60f;
volumeFogColor = new Color(0.2627451f, 2f / 15f, 1f / 15f);
lightNoiseControl = new Vector4(0.7f, 0f, 0.5f, 6f);
volumeFogDensity = 0.3f;
heigthNoiseDensities = new Vector2(15f, 0.5f);
volumeFogNoisePower = 0.25f;
volumeNoiseScale = 0.002f;
noiseSpeed = 100f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(110f, 10f, 100f, 30f), "Dust Light"))
{
volumeLightPower = 0.01f;
volumeFogNoise = 0.12f;
volumeFogHeight = 105f;
volumeFogColor = new Color(0.972549f, 39f / 85f, 10f / 51f);
lightNoiseControl = new Vector4(0.7f, 0f, 0.5f, 6f);
volumeFogDensity = 0.056f;
heigthNoiseDensities = new Vector2(8f, 1f);
volumeFogNoisePower = 0.55f;
volumeNoiseScale = 0.18f;
noiseSpeed = 40f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(210f, 10f, 100f, 30f), "Heavy Fog"))
{
volumeLightPower = 1.05f;
volumeFogNoise = 0.1f;
volumeFogHeight = 60f;
volumeFogColor = Color.white * 0.15f;
lightNoiseControl = new Vector4(0.75f, 0f, 0.5f, 3f);
volumeFogDensity = 0.3f;
heigthNoiseDensities = new Vector2(15f, 0.5f);
volumeFogNoisePower = 0.25f;
volumeNoiseScale = 0.002f;
noiseSpeed = 100f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(310f, 10f, 100f, 30f), "Light Fog"))
{
volumeLightPower = 1.05f;
volumeFogNoise = 0.1f;
volumeFogHeight = 60f;
volumeFogColor = Color.white * 0.55f;
lightNoiseControl = new Vector4(0.75f, 0f, 0.5f, 3f);
volumeFogDensity = 0.12f;
heigthNoiseDensities = new Vector2(15f, 0.5f);
volumeFogNoisePower = 0.55f;
volumeNoiseScale = 0.15f;
noiseSpeed = 70f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(410f, 10f, 100f, 30f), "Snow Fog"))
{
volumeLightPower = 0.05f;
volumeFogNoise = 0.1f;
volumeFogHeight = 460f;
volumeFogColor = new Color(0.5803922f, 0.5803922f, 0.5803922f);
lightNoiseControl = new Vector4(1f, 0f, 0.5f, 3f);
volumeFogDensity = 0.01f;
heigthNoiseDensities = new Vector2(5.5f, 1.35f);
volumeFogNoisePower = 14f;
volumeNoiseScale = 0.01f;
noiseSpeed = 100f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(510f, 10f, 100f, 30f), "Snow Heavy"))
{
volumeLightPower = 0.05f;
volumeFogNoise = 0.1f;
volumeFogHeight = 620f;
volumeFogColor = new Color(50f / 51f, 50f / 51f, 50f / 51f);
lightNoiseControl = new Vector4(1f, -12f, 0.35f, 2f);
volumeFogDensity = 0.015f;
heigthNoiseDensities = new Vector2(5.5f, 1.35f);
volumeFogNoisePower = 14f;
volumeNoiseScale = 0.18f;
noiseSpeed = 30f;
clearskyFactor = 0.07f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(610f, 10f, 100f, 30f), "Sun Shafts"))
{
volumeLightPower = 0.75f;
volumeFogNoise = 0.01f;
volumeFogHeight = 0f;
volumeFogColor = new Color(0.11372549f, 0.11372549f, 0.11372549f);
lightNoiseControl = new Vector4(0.75f, 0f, 0.5f, 3f);
volumeFogDensity = 0.01f;
heigthNoiseDensities = new Vector2(0f, 0f);
volumeFogNoisePower = 0.05f;
volumeNoiseScale = 0f;
noiseSpeed = 0f;
clearskyFactor = 0.43f;
water.gameObject.SetActive(value: false);
reflection.enabled = false;
depthRenderer.enabled = false;
}
if (GUI.Button(new Rect(710f, 10f, 100f, 30f), "Clear Fog"))
{
volumeLightPower = 0.5f;
volumeFogNoise = 0.01f;
volumeFogHeight = 0f;
volumeFogColor = new Color(0.11372549f, 0.11372549f, 0.11372549f);
lightNoiseControl = new Vector4(0.75f, 0f, 0.5f, 3f);
volumeFogDensity = 0.01f;
heigthNoiseDensities = new Vector2(0f, 0f);
volumeFogNoisePower = 0.05f;
volumeNoiseScale = 0f;
noiseSpeed = 0f;
clearskyFactor = 0.43f;
water.gameObject.SetActive(value: true);
reflection.enabled = true;
depthRenderer.enabled = true;
}
if (GUI.Button(new Rect(10f, 70f, 100f, 30f), "Sunny"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.Sunny;
skyManager.WeatherSeverity = 1f;
}
if (GUI.Button(new Rect(110f, 70f, 100f, 30f), "Cloudy"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.Cloudy;
skyManager.WeatherSeverity = 1f;
}
if (GUI.Button(new Rect(210f, 70f, 100f, 30f), "Light Rain"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.Rain;
skyManager.WeatherSeverity = 10f;
}
if (GUI.Button(new Rect(310f, 70f, 100f, 30f), "Heavy Rain"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.Rain;
skyManager.WeatherSeverity = 20f;
}
if (GUI.Button(new Rect(410f, 70f, 100f, 30f), "Light Snow"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.SnowStorm;
skyManager.WeatherSeverity = 10f;
}
if (GUI.Button(new Rect(510f, 70f, 100f, 30f), "Heavy Snow"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.SnowStorm;
skyManager.WeatherSeverity = 20f;
}
if (GUI.Button(new Rect(610f, 70f, 100f, 30f), "Lightning"))
{
skyManager.currentWeatherName = SkyMasterManager.Volume_Weather_types.LightningStorm;
skyManager.WeatherSeverity = 20f;
}
}
}
private void OnEnable()
{
skyPreset = skyManager.Preset;
fExposureOffset = skyManager.fExposureOffset;
fWaveLengthOffset = skyManager.fWaveLengthOffset;
gOffset = skyManager.gOffset;
scaleDifOffset = skyManager.scaleDifOffset;
tintColorOffset = skyManager.tintColorOffset;
sunRingFactorOffset = skyManager.sunRingFactorOffset;
Sun_halo_factor = skyManager.Sun_halo_factor;
Sun_eclipse_factor = skyManager.Sun_eclipse_factor;
Glob_scale = skyManager.Glob_scale;
Esun = skyManager.m_ESun;
Kr = skyManager.m_Kr;
Km = skyManager.m_Km;
fsamples = skyManager.m_fSamples;
fRayleightScaleDepth = skyManager.m_fRayleighScaleDepth;
coloration = skyManager.m_Coloration;
}
private void Update()
{
if (passSettingsToEclipse)
{
fExposureOffsetS = skyManager.fExposureOffset;
fWaveLengthOffsetS = skyManager.fWaveLengthOffset;
gOffsetS = skyManager.gOffset;
scaleDifOffsetS = skyManager.scaleDifOffset;
tintColorOffsetS = skyManager.tintColorOffset;
sunRingFactorOffsetS = skyManager.sunRingFactorOffset;
Sun_halo_factorS = skyManager.Sun_halo_factor;
Sun_eclipse_factorS = skyManager.Sun_eclipse_factor;
Glob_scaleS = skyManager.Glob_scale;
passSettingsToEclipse = false;
}
if (useEclipseSystem && (Application.isPlaying || eclipseInEditor))
{
if (!eclipseByAngle)
{
if (activateEclipse)
{
if (!eclipseActivated)
{
eclipseActivated = true;
}
if (skyManager.fExposureOffset != fExposureOffsetS)
{
skyManager.fExposureOffset = Mathf.Lerp(skyManager.fExposureOffset, fExposureOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.fWaveLengthOffset != fWaveLengthOffsetS)
{
skyManager.fWaveLengthOffset = Vector3.Lerp(skyManager.fWaveLengthOffset, fWaveLengthOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.gOffset != gOffsetS)
{
skyManager.gOffset = Mathf.Lerp(skyManager.gOffset, gOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.scaleDifOffset != scaleDifOffsetS)
{
skyManager.scaleDifOffset = Mathf.Lerp(skyManager.scaleDifOffset, scaleDifOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.tintColorOffset != tintColorOffsetS)
{
skyManager.tintColorOffset = Vector3.Lerp(skyManager.tintColorOffset, tintColorOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.sunRingFactorOffset != sunRingFactorOffsetS)
{
skyManager.sunRingFactorOffset = Mathf.Lerp(skyManager.sunRingFactorOffset, sunRingFactorOffsetS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Sun_halo_factor != Sun_halo_factorS)
{
skyManager.Sun_halo_factor = Mathf.Lerp(skyManager.Sun_halo_factor, Sun_halo_factorS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Sun_eclipse_factor != Sun_eclipse_factorS)
{
skyManager.Sun_eclipse_factor = Mathf.Lerp(skyManager.Sun_eclipse_factor, Sun_eclipse_factorS, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Glob_scale != Glob_scaleS)
{
skyManager.Glob_scale = Mathf.Lerp(skyManager.Glob_scale, Glob_scaleS, Time.deltaTime * 2f * eclipseSpeed);
}
}
else
{
if (skyManager.fExposureOffset != fExposureOffset)
{
skyManager.fExposureOffset = Mathf.Lerp(skyManager.fExposureOffset, fExposureOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.fWaveLengthOffset != fWaveLengthOffset)
{
skyManager.fWaveLengthOffset = Vector3.Lerp(skyManager.fWaveLengthOffset, fWaveLengthOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.gOffset != gOffset)
{
skyManager.gOffset = Mathf.Lerp(skyManager.gOffset, gOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.scaleDifOffset != scaleDifOffset)
{
skyManager.scaleDifOffset = Mathf.Lerp(skyManager.scaleDifOffset, scaleDifOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.tintColorOffset != tintColorOffset)
{
skyManager.tintColorOffset = Vector3.Lerp(skyManager.tintColorOffset, tintColorOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.sunRingFactorOffset != sunRingFactorOffset)
{
skyManager.sunRingFactorOffset = Mathf.Lerp(skyManager.sunRingFactorOffset, sunRingFactorOffset, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Sun_halo_factor != Sun_halo_factor)
{
skyManager.Sun_halo_factor = Mathf.Lerp(skyManager.Sun_halo_factor, Sun_halo_factor, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Sun_eclipse_factor != Sun_eclipse_factor)
{
skyManager.Sun_eclipse_factor = Mathf.Lerp(skyManager.Sun_eclipse_factor, Sun_eclipse_factor, Time.deltaTime * 2f * eclipseSpeed);
}
if (skyManager.Glob_scale != Glob_scale)
{
skyManager.Glob_scale = Mathf.Lerp(skyManager.Glob_scale, Glob_scale, Time.deltaTime * 2f * eclipseSpeed);
}
}
}
else
{
float t = (Mathf.Abs(Vector3.Dot((skyManager.MoonObj.transform.position - Camera.main.transform.position).normalized, skyManager.SUN_LIGHT.transform.forward.normalized)) - 0.965f) / 0.03490001f;
skyManager.fExposureOffset = Mathf.Lerp(fExposureOffset, fExposureOffsetS, t);
skyManager.fWaveLengthOffset = Vector3.Lerp(fWaveLengthOffset, fWaveLengthOffsetS, t);
skyManager.gOffset = Mathf.Lerp(gOffset, gOffsetS, t);
skyManager.scaleDifOffset = Mathf.Lerp(scaleDifOffset, scaleDifOffsetS, t);
skyManager.tintColorOffset = Vector3.Lerp(tintColorOffset, tintColorOffsetS, t);
skyManager.sunRingFactorOffset = Mathf.Lerp(sunRingFactorOffset, sunRingFactorOffsetS, t);
skyManager.Sun_halo_factor = Mathf.Lerp(Sun_halo_factor, Sun_halo_factorS, t);
skyManager.Sun_eclipse_factor = Mathf.Lerp(Sun_eclipse_factor, Sun_eclipse_factorS, t);
skyManager.Glob_scale = Mathf.Lerp(Glob_scale, Glob_scaleS, t);
}
}
skyManager.Preset = skyPreset;
if (advancedSkyOffsets && !eclipseByAngle && !activateEclipse && (!useEclipseSystem || (useEclipseSystem && !Application.isPlaying && !eclipseInEditor)))
{
skyManager.fExposureOffset = fExposureOffset;
skyManager.fWaveLengthOffset = fWaveLengthOffset;
skyManager.gOffset = gOffset;
skyManager.scaleDifOffset = scaleDifOffset;
skyManager.tintColorOffset = tintColorOffset;
skyManager.sunRingFactorOffset = sunRingFactorOffset;
skyManager.Sun_halo_factor = Sun_halo_factor;
skyManager.Sun_eclipse_factor = Sun_eclipse_factor;
skyManager.Glob_scale = Glob_scale;
}
if (advancedSkyOptions)
{
skyManager.m_ESun = Esun;
skyManager.m_Kr = Kr;
skyManager.m_Km = Km;
skyManager.m_fSamples = fsamples;
skyManager.m_fRayleighScaleDepth = fRayleightScaleDepth;
skyManager.m_Coloration = coloration;
}
if (autoMoonPhase)
{
skyManager.AutoMoonLighting = true;
}
else
{
skyManager.AutoMoonLighting = false;
if (!activateEclipse)
{
if (eclipseByAngle)
{
float t2 = (Mathf.Abs(Vector3.Dot((skyManager.MoonObj.transform.position - Camera.main.transform.position).normalized, skyManager.SUN_LIGHT.transform.forward.normalized)) - 0.965f) / 0.03490001f;
if (controlMoonPhase && MoonA != null)
{
MoonA.SetVector("_SunDir", Vector3.Lerp(moonLightDirection, new Vector3(0f, 0f, 50000f), t2));
MoonA.SetColor("_Color", Color.Lerp(MoonSunLight, MoonSunLightS, t2));
MoonA.SetColor("_Ambient", Color.Lerp(MoonAmbientLight, MoonAmbientLightS, t2));
MoonA.SetColor("_ColorTint", Color.Lerp(MoonSkyLight, MoonSkyLightS, t2));
}
if (controlMoonPhase && MoonB != null)
{
MoonB.SetVector("_SunDir", Vector3.Lerp(moonLightDirection, new Vector3(0f, 0f, 50000f), t2));
MoonB.SetColor("_Color", Color.Lerp(MoonSunLight, MoonSunLightS, t2));
MoonB.SetColor("_Ambient", Color.Lerp(MoonAmbientLight, MoonAmbientLightS, t2));
MoonB.SetColor("_ColorTint", Color.Lerp(MoonSkyLight, MoonSkyLightS, t2));
}
}
else
{
if (controlMoonPhase && MoonA != null)
{
Vector3 a = MoonA.GetVector("_SunDir");
MoonA.SetVector("_SunDir", Vector3.Lerp(a, moonLightDirection, Time.deltaTime * 2f * eclipseSpeed));
Color color = MoonA.GetColor("_Color");
MoonA.SetColor("_Color", Color.Lerp(color, MoonSunLight, Time.deltaTime * 2f * eclipseSpeed));
Color color2 = MoonA.GetColor("_Ambient");
MoonA.SetColor("_Ambient", Color.Lerp(color2, MoonAmbientLight, Time.deltaTime * 2f * eclipseSpeed));
if (tintMoonBySkyGrad)
{
Color color3 = MoonA.GetColor("_ColorTint");
MoonA.SetColor("_ColorTint", Color.Lerp(color3, skyManager.gradSkyColor, Time.deltaTime * 2f * eclipseSpeed));
}
else
{
Color color4 = MoonA.GetColor("_ColorTint");
MoonA.SetColor("_ColorTint", Color.Lerp(color4, MoonSkyLight, Time.deltaTime * 2f * eclipseSpeed));
}
}
if (controlMoonPhase && MoonB != null)
{
Vector3 a2 = MoonB.GetVector("_SunDir");
MoonB.SetVector("_SunDir", Vector3.Lerp(a2, moonLightDirection, Time.deltaTime * 2f * eclipseSpeed));
Color color5 = MoonB.GetColor("_Color");
MoonB.SetColor("_Color", Color.Lerp(color5, MoonSunLight, Time.deltaTime * 2f * eclipseSpeed));
Color color6 = MoonB.GetColor("_Ambient");
MoonB.SetColor("_Ambient", Color.Lerp(color6, MoonAmbientLight, Time.deltaTime * 2f * eclipseSpeed));
if (tintMoonBySkyGrad)
{
Color color7 = MoonB.GetColor("_ColorTint");
MoonB.SetColor("_ColorTint", Color.Lerp(color7, skyManager.gradSkyColor, Time.deltaTime * 2f * eclipseSpeed));
}
else
{
Color color8 = MoonB.GetColor("_ColorTint");
MoonB.SetColor("_ColorTint", Color.Lerp(color8, MoonSkyLight, Time.deltaTime * 2f * eclipseSpeed));
}
}
}
}
else
{
if (controlMoonPhase && MoonA != null)
{
Vector3 a3 = MoonA.GetVector("_SunDir");
MoonA.SetVector("_SunDir", Vector3.Lerp(a3, new Vector3(0f, 0f, 50000f), Time.deltaTime * 2f * eclipseSpeed));
Color color9 = MoonA.GetColor("_Color");
MoonA.SetColor("_Color", Color.Lerp(color9, MoonSunLightS, Time.deltaTime * 2f * eclipseSpeed));
Color color10 = MoonA.GetColor("_Ambient");
MoonA.SetColor("_Ambient", Color.Lerp(color10, MoonAmbientLightS, Time.deltaTime * 2f * eclipseSpeed));
Color color11 = MoonA.GetColor("_ColorTint");
MoonA.SetColor("_ColorTint", Color.Lerp(color11, MoonSkyLightS, Time.deltaTime * 2f * eclipseSpeed));
}
if (controlMoonPhase && MoonB != null)
{
Vector3 a4 = MoonB.GetVector("_SunDir");
MoonB.SetVector("_SunDir", Vector3.Lerp(a4, new Vector3(0f, 0f, 50000f), Time.deltaTime * 2f * eclipseSpeed));
Color color12 = MoonB.GetColor("_Color");
MoonB.SetColor("_Color", Color.Lerp(color12, MoonSunLightS, Time.deltaTime * 2f * eclipseSpeed));
Color color13 = MoonB.GetColor("_Ambient");
MoonB.SetColor("_Ambient", Color.Lerp(color13, MoonAmbientLightS, Time.deltaTime * 2f * eclipseSpeed));
Color color14 = MoonB.GetColor("_ColorTint");
MoonB.SetColor("_ColorTint", Color.Lerp(color14, MoonSkyLightS, Time.deltaTime * 2f * eclipseSpeed));
}
}
}
if (activateGUI && enableGUI)
{
_ = Application.isPlaying;
}
if (skyManager.skyboxMat != null)
{
if (skyManager.skyboxMat.HasProperty("_Color"))
{
Color color15 = skyManager.skyboxMat.GetColor("_Color");
if ((!skyManager.AutoSunPosition && ((skyManager.Current_Time >= 9f + skyManager.Shift_dawn) & (skyManager.Current_Time <= skyManager.NightTimeMax + skyManager.Shift_dawn))) | (skyManager.AutoSunPosition && skyManager.Rot_Sun_X > 0f))
{
if (skyManager.Current_Time < 1f)
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.y));
}
else
{
skyManager.skyboxMat.SetColor("_Color", Color.Lerp(color15, new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.y), Time.deltaTime));
}
}
else if (skyManager.Current_Time < 1f)
{
skyManager.skyboxMat.SetColor("_Color", new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.x));
}
else
{
skyManager.skyboxMat.SetColor("_Color", Color.Lerp(color15, new Color(skyManager.StarsColor.r, skyManager.StarsColor.g, skyManager.StarsColor.b, 1f - skyManager.MinMaxStarsTransp.x), Time.deltaTime));
}
}
if (skyManager.skyboxMat.HasProperty("_Light"))
{
float a5 = skyManager.skyboxMat.GetFloat("_Light");
skyManager.skyboxMat.SetFloat("_Light", Mathf.Lerp(a5, skyManager.StarsIntensity, Time.deltaTime));
}
}
if (temporalSunMoon == null)
{
temporalSunMoon = new GameObject();
temporalSunMoon.name = "SunMoonTransformLerp";
temporalSunMoon.transform.rotation = skyManager.SUN_LIGHT.transform.rotation;
temporalSunMoon.transform.position = skyManager.SUN_LIGHT.transform.position;
temporalSunMoon.AddComponent<Light>();
_ = fullVolumeClouds.sunLight;
fullVolumeClouds.sunLight = temporalSunMoon.GetComponent<Light>();
}
_ = Application.isPlaying;
if (shaderVolClouds != null)
{
shaderVolClouds.WeatherDensity = true;
}
if (affectCloudDensity)
{
if (Application.isPlaying)
{
setFullVolumeCloudsDensity(lerp: true);
}
else
{
setFullVolumeCloudsDensity(lerp: false);
}
if (fullVolumeCloudsREFL != null)
{
fullVolumeCloudsREFL.density = fullVolumeClouds.density;
fullVolumeCloudsREFL.coverage = fullVolumeClouds.coverage;
fullVolumeCloudsREFL.scale = fullVolumeClouds.scale;
fullVolumeCloudsREFL.detailScale = fullVolumeClouds.detailScale;
fullVolumeCloudsREFL.lowFreqMin = fullVolumeClouds.lowFreqMin;
fullVolumeCloudsREFL.lowFreqMax = fullVolumeClouds.lowFreqMax;
fullVolumeCloudsREFL.highFreqModifier = fullVolumeClouds.highFreqModifier;
fullVolumeCloudsREFL.weatherScale = fullVolumeClouds.weatherScale;
fullVolumeCloudsREFL.startHeight = fullVolumeClouds.startHeight;
fullVolumeCloudsREFL.thickness = fullVolumeClouds.thickness;
fullVolumeCloudsREFL.planetSize = fullVolumeClouds.planetSize;
fullVolumeCloudsREFL.cloudSampleMultiplier = fullVolumeClouds.cloudSampleMultiplier;
fullVolumeCloudsREFL.globalMultiplier = fullVolumeClouds.globalMultiplier;
fullVolumeCloudsREFL.windSpeed = fullVolumeClouds.windSpeed;
fullVolumeCloudsREFL.windDirection = fullVolumeClouds.windDirection;
fullVolumeCloudsREFL.coverageWindSpeed = fullVolumeClouds.coverageWindSpeed;
fullVolumeCloudsREFL.coverageWindDirection = fullVolumeClouds.coverageWindDirection;
}
}
setFullVolumeCloudsColors();
if (ApplyPresetDensities)
{
applyPresetDens();
ApplyPresetDensities = false;
}
}
public void applyPresetDens()
{
weatherCloudDensities.Clear();
if (cloudType == 0)
{
weatherCloudDensities.Add(0f);
weatherCloudDensities.Add(0.4f);
weatherCloudDensities.Add(1.2f);
weatherCloudDensities.Add(1.4f);
weatherCloudDensities.Add(1.5f);
weatherCloudDensities.Add(1.5f);
weatherCloudDensities.Add(1.1f);
weatherCloudDensities.Add(2f);
weatherCloudDensities.Add(2f);
weatherCloudDensities.Add(2f);
weatherCloudDensities.Add(1f);
weatherCloudDensities.Add(0.4f);
weatherCloudDensities.Add(0.4f);
weatherCloudDensities.Add(0.9f);
}
}
public void setFullVolumeCloudsDensity(bool lerp)
{
if (weatherCloudDensities.Count < 14)
{
applyPresetDens();
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.Sunny)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[0] + densitiesOffset, 0f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.Foggy)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[1] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.HeavyFog)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[2] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.Tornado)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[3] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.SnowStorm)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[4] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.FreezeStorm)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[5] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.FlatClouds)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[6] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.HeavyStorm)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[8] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.HeavyStormDark)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[9] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.RollingFog)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[11] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.VolcanoErupt)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[12] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.Rain)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[13] + densitiesOffset, 1f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.Cloudy)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[10] + densitiesOffset, 1.32f, lerp);
}
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.LightningStorm)
{
setFullVolumeCloudsDensityA(weatherCloudDensities[7] + densitiesOffset, 1.65f, lerp);
lightningController.EnableLightning = true;
}
else
{
lightningController.EnableLightning = forceLightning;
}
}
public void setFullVolumeCloudsDensityA(float density, float darkness, bool lerp)
{
if (lerp)
{
fullVolumeClouds.coverage = Mathf.Lerp(fullVolumeClouds.coverage, density, cloudTransitionSpeed * Time.deltaTime * 0.05f);
fullVolumeClouds.density = Mathf.Lerp(fullVolumeClouds.density, darkness + densityThicknessOffset, cloudTransitionSpeed * Time.deltaTime * 0.05f);
}
else
{
fullVolumeClouds.coverage = density;
fullVolumeClouds.density = darkness + densityThicknessOffset;
}
}
public void setFullVolumeCloudsColors()
{
setFullVolumeCloudsColorsA();
}
public void setFullVolumeCloudsColorsA()
{
if (skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.HeavyStorm || skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.HeavyStormDark || skyManager.currentWeatherName == SkyMasterManager.Volume_Weather_types.LightningStorm)
{
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, cloudStormColor, 0.05f * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, cloudStormAmbientColor, 0.05f * cloudColorSpeed * Time.deltaTime);
}
else
{
if (cloudColor != cloudStormColor)
{
cloudColor = cloudStormColor;
}
if (cloudsAmbientColor != cloudStormAmbientColor)
{
cloudsAmbientColor = cloudStormAmbientColor;
}
}
}
else if ((!skyManager.AutoSunPosition && skyManager.Current_Time < 18f + skyManager.Shift_dawn && skyManager.Current_Time > 9f + skyManager.Shift_dawn) || (skyManager.AutoSunPosition && skyManager.Rot_Sun_X > 0f))
{
if (temporalSunMoon != null)
{
temporalSunMoon.transform.rotation = Quaternion.Lerp(temporalSunMoon.transform.rotation, skyManager.SUN_LIGHT.transform.rotation, cloudColorSpeedD * 0.1f * Time.deltaTime);
temporalSunMoon.transform.position = Vector3.Lerp(temporalSunMoon.transform.position, skyManager.SUN_LIGHT.transform.position, cloudColorSpeedD * 0.1f * Time.deltaTime);
}
if ((skyManager.AutoSunPosition && skyManager.Rot_Sun_X < 25f) || (!skyManager.AutoSunPosition && skyManager.Current_Time > 17f + skyManager.Shift_dawn))
{
float num = 11f;
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Dusk_Sun_Color, 0.05f * num * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Dusk_Ambient_Color, 0.05f * num * Time.deltaTime);
}
else
{
if (cloudColor != Dusk_Sun_Color)
{
cloudColor = Dusk_Sun_Color;
}
if (cloudsAmbientColor != Dusk_Ambient_Color)
{
cloudsAmbientColor = Dusk_Ambient_Color;
}
}
}
else if ((skyManager.AutoSunPosition && skyManager.Rot_Sun_X < 65f) || (!skyManager.AutoSunPosition && skyManager.Current_Time > 12f + skyManager.Shift_dawn))
{
float num2 = 3f;
num2 = 0.7f;
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Day_Sun_Color, 0.05f * num2 * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Day_Ambient_Color, 0.5f * num2 * Time.deltaTime);
}
else
{
if (cloudColor != Day_Sun_Color)
{
cloudColor = Day_Sun_Color;
}
if (cloudsAmbientColor != Day_Ambient_Color)
{
cloudsAmbientColor = Day_Ambient_Color;
}
}
}
else
{
float num3 = 3f;
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Dawn_Sun_Color, 0.05f * num3 * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Dawn_Ambient_Color, 0.5f * num3 * Time.deltaTime);
}
else
{
if (cloudColor != Dawn_Sun_Color)
{
cloudColor = Dawn_Sun_Color;
}
if (cloudsAmbientColor != Dawn_Ambient_Color)
{
cloudsAmbientColor = Dawn_Ambient_Color;
}
}
}
}
else if ((skyManager.AutoSunPosition && skyManager.Rot_Sun_X < 15f) || (!skyManager.AutoSunPosition && skyManager.Current_Time <= 9f + skyManager.Shift_dawn && skyManager.Current_Time > 1f + skyManager.Shift_dawn))
{
float num4 = 0.5f;
if (temporalSunMoon != null)
{
temporalSunMoon.transform.rotation = Quaternion.Lerp(temporalSunMoon.transform.rotation, skyManager.MOON_LIGHT.transform.rotation, cloudColorSpeedD * 0.1f * Time.deltaTime);
temporalSunMoon.transform.position = Vector3.Lerp(temporalSunMoon.transform.position, skyManager.MOON_LIGHT.transform.position, cloudColorSpeedD * 0.1f * Time.deltaTime);
}
if ((skyManager.AutoSunPosition && skyManager.Rot_Sun_X < 5f) || (!skyManager.AutoSunPosition && skyManager.Current_Time < 8.7f + skyManager.Shift_dawn))
{
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Night_Sun_Color, 1.5f * num4 * Time.deltaTime * cloudColorSpeed);
}
else if (cloudColor != Night_Sun_Color)
{
cloudColor = Night_Sun_Color;
}
}
else if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Dawn_Sun_Color, num4 * Time.deltaTime * cloudColorSpeed);
}
else if (cloudColor != Dawn_Sun_Color)
{
cloudColor = Dawn_Sun_Color;
}
if (Application.isPlaying)
{
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Night_Ambient_Color, 2f * num4 * Time.deltaTime);
}
else if (cloudsAmbientColor != Night_Ambient_Color)
{
cloudsAmbientColor = Night_Ambient_Color;
}
}
else
{
float num5 = 0.5f;
if ((skyManager.AutoSunPosition && skyManager.Rot_Sun_X < 0f) || (!skyManager.AutoSunPosition && skyManager.Current_Time > 22f + skyManager.Shift_dawn) || ((skyManager.Current_Time >= 0f) & (skyManager.Current_Time <= 1f + skyManager.Shift_dawn)))
{
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Night_Sun_Color, 1.5f * num5 * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Night_Ambient_Color, 2f * num5 * Time.deltaTime);
}
else
{
if (cloudColor != Night_Sun_Color)
{
cloudColor = Night_Sun_Color;
}
if (cloudsAmbientColor != Night_Ambient_Color)
{
cloudsAmbientColor = Night_Ambient_Color;
}
}
if (skyManager.Current_Time >= 0.45f)
{
temporalSunMoon.transform.rotation = Quaternion.Lerp(temporalSunMoon.transform.rotation, skyManager.MOON_LIGHT.transform.rotation, cloudColorSpeedN * 0.1f * Time.deltaTime);
temporalSunMoon.transform.position = Vector3.Lerp(temporalSunMoon.transform.position, skyManager.MOON_LIGHT.transform.position, cloudColorSpeedN * 0.1f * Time.deltaTime);
}
else
{
temporalSunMoon.transform.rotation = Quaternion.Lerp(temporalSunMoon.transform.rotation, skyManager.SUN_LIGHT.transform.rotation, cloudColorSpeedN * 0.1f * Time.deltaTime);
temporalSunMoon.transform.position = Vector3.Lerp(temporalSunMoon.transform.position, skyManager.SUN_LIGHT.transform.position, cloudColorSpeedN * 0.1f * Time.deltaTime);
}
}
else
{
if (temporalSunMoon != null)
{
temporalSunMoon.transform.rotation = Quaternion.Lerp(temporalSunMoon.transform.rotation, skyManager.SUN_LIGHT.transform.rotation, cloudColorSpeedD * 0.1f * Time.deltaTime);
temporalSunMoon.transform.position = Vector3.Lerp(temporalSunMoon.transform.position, skyManager.SUN_LIGHT.transform.position, cloudColorSpeedD * 0.1f * Time.deltaTime);
}
if (Application.isPlaying)
{
cloudColor = Color.Lerp(cloudColor, Dusk_Sun_Color, 0.5f * num5 * Time.deltaTime * cloudColorSpeed);
cloudsAmbientColor = Color.Lerp(cloudsAmbientColor, Dusk_Ambient_Color, 0.5f * num5 * Time.deltaTime);
}
else
{
if (cloudColor != Dusk_Sun_Color)
{
cloudColor = Dusk_Sun_Color;
}
if (cloudsAmbientColor != Dusk_Ambient_Color)
{
cloudsAmbientColor = Dusk_Ambient_Color;
}
}
}
}
if (!affectCloudColor || !(fullVolumeClouds != null))
{
return;
}
fullVolumeClouds.highSunColor = cloudColor;
fullVolumeClouds.cloudBaseColor = cloudsAmbientColor;
if (affectCloudTopColor)
{
fullVolumeClouds.cloudTopColor = cloudsAmbientColor;
}
fullVolumeClouds._SkyTint = new Vector3(cloudColor.r, cloudColor.g, cloudColor.b);
if (fullVolumeCloudsREFL != null)
{
fullVolumeCloudsREFL.highSunColor = fullVolumeClouds.highSunColor;
fullVolumeCloudsREFL.cloudBaseColor = fullVolumeClouds.cloudBaseColor;
fullVolumeCloudsREFL._SkyTint = fullVolumeClouds._SkyTint;
if (affectCloudTopColor)
{
fullVolumeCloudsREFL.cloudTopColor = fullVolumeClouds.cloudTopColor;
}
}
}
}
}