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

8589 lines
320 KiB
C#

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
namespace Artngame.SKYMASTER
{
[ExecuteInEditMode]
public class SkyMasterManager : MonoBehaviour
{
public enum Volume_Weather_types
{
Sunny = 0,
Foggy = 1,
HeavyFog = 2,
Tornado = 3,
SnowStorm = 4,
FreezeStorm = 5,
FlatClouds = 6,
LightningStorm = 7,
HeavyStorm = 8,
HeavyStormDark = 9,
Cloudy = 10,
RollingFog = 11,
VolcanoErupt = 12,
Rain = 13
}
public enum Weather_types
{
Sunny = 0,
Foggy = 1,
HeavyFog = 2,
Tornado = 3,
SnowStorm = 4,
FreezeStorm = 5,
FlatClouds = 6,
LightningStorm = 7,
HeavyStorm = 8,
HeavyStormDark = 9,
Cloudy = 10,
RollingFog = 11,
VolcanoErupt = 12,
Rain = 13
}
public bool instaChangeSkyColor;
public bool instaKillParticles;
public FullVolumeCloudsSkyMaster volumeClouds;
public FogMode fogMode = FogMode.ExponentialSquared;
public bool disableSunAtNight;
public bool gradAffectsFog = true;
public float White_cutoffOffset = 5f;
public Transform VolShaderClouds;
public CloudHandlerSM VolShaderCloudsH;
public bool SunFollowHero;
public AtmosphericScatteringSkyMaster VolLightingH;
public AtmosphericScatteringDeferredSkyMaster VolLightingDefH;
[Range(1f, 20f)]
public float WeatherSeverity = 10f;
[Range(-12f, 12f)]
public float Time_zone;
[HideInInspector]
public float MaxSunElevation;
[HideInInspector]
public Color gradSkyColor;
[HideInInspector]
public float calcColorTime;
public bool UseGradients;
public Gradient SkyColorGrad;
public Gradient SkyTintGrad;
public float FogColorPow = 1.7f;
public float FogWaterPow = 1.4f;
public AnimationCurve FexposureC = new AnimationCurve(new Keyframe(0f, 0.3f), new Keyframe(0.3f, 0f), new Keyframe(0.7f, 0f), new Keyframe(1f, 0.3f));
public AnimationCurve FscaleDiffC = new AnimationCurve(new Keyframe(0f, 0.001f), new Keyframe(0.3f, 0.001f), new Keyframe(0.7f, 0.001f), new Keyframe(1f, 0.001f));
public AnimationCurve FSunGC = new AnimationCurve(new Keyframe(0f, 0.95f), new Keyframe(0.3f, 0.99f), new Keyframe(0.7f, 0.99f), new Keyframe(1f, 0.95f));
public AnimationCurve FSunringC = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.3f, 0f), new Keyframe(0.7f, 0f), new Keyframe(1f, 0f));
public bool VolCloudGradients;
public Gradient VolCloudLitGrad;
public Gradient VolCloudShadGrad;
public Gradient VolCloudFogGrad;
public float VolCloudTransp = 0.7f;
[HideInInspector]
public Color gradCloudLitColor;
[HideInInspector]
public Color gradCloudShadeColor;
[HideInInspector]
public Color gradCloudFogColor;
[HideInInspector]
public float VcloudSunIntensity;
[HideInInspector]
public float VcloudLightDiff;
[HideInInspector]
public float VcloudFog;
[SerializeField]
public AnimationCurve IntensityDiff = new AnimationCurve(new Keyframe(0f, 0.4f), new Keyframe(0.374f, 0.293f), new Keyframe(0.6f, 0.2766f), new Keyframe(0.757f, 0.278f), new Keyframe(0.798f, 0.2713f), new Keyframe(0.8495f, 0.2752f), new Keyframe(0.887f, 0.249f), new Keyframe(0.944f, 0.28f), new Keyframe(1f, 0.4f));
[SerializeField]
public AnimationCurve IntensityFog = new AnimationCurve(new Keyframe(0f, 5f), new Keyframe(0.75f, 10f), new Keyframe(0.883f, 10.91f), new Keyframe(1f, 5f));
[SerializeField]
public AnimationCurve IntensitySun = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.186f, 0.148f), new Keyframe(0.71f, 0.13f), new Keyframe(0.84f, 0.3f), new Keyframe(0.9f, 0.13f), new Keyframe(1f, 0f));
public bool Lerp_sky_rot;
public bool LatLonMoonPos;
public bool AutoMoonLighting;
public Transform MoonCenterObj;
public bool StarsFollowMoon;
public bool AutoMoonFade;
public Color MoonColor = new Color(0.9f, 0.9f, 0.9f, 0.9f);
public Color MoonAmbientColor = new Color(0.9f, 0.9f, 0.9f, 1f);
public Vector3 MinMaxEclMoonTransp = new Vector3(0.2f, 0.9f, 0.1f);
public float MoonSunLight = 0.02f;
public float MoonCoverage = 0.377f;
public float MoonSize = 1f;
public Material StarsMaterial;
public Color StarsColor = new Color(0.9f, 0.9f, 0.9f, 0.9f);
public Vector2 MinMaxStarsTransp = new Vector2(0.5f, 1f);
public float StarsIntensity = 1.4f;
public float MoonPlaneRot;
public bool onEclipse;
public float DawnAppearSpeed = 1f;
public float StarsPFadeSpeed = 0.5f;
public float StarsPMaxGlow = 0.8f;
public bool AutoSunPosition;
public float RotateNorth;
public float Latitude = 15f;
public float Longitude = 45f;
public float NightTimeMax = 22.4f;
public float NightAngleMax;
public float SkyColorationOffset;
public float divideSnowTerrain = 14f;
public List<int> VFogsPerVWeather = new List<int>();
private Transform Cam_tranform;
public float AmplifyWind = 1f;
public float WorldScale = 20f;
public float prevWorldScale = 20f;
public bool MoonPhases;
public float max_moon_intensity = 0.25f;
public Material MoonPhasesMat;
public bool ScreenRainDrops;
public Transform RainDropsPlane;
public Material ScreenRainDropsMat;
public bool ScreenFreezeFX;
public bool FreezeInwards;
public float MaxDropSpeed = 6f;
public float MaxWater = 1f;
public float MaxRefract = 4.5f;
public float FreezeSpeed = 0.2f;
public Transform water;
public float RainDistAboveHero = 10f;
public GameObject SunSystem;
[SerializeField]
public WeatherSM currentWeather;
public WeatherSM prevWeather;
public Volume_Weather_types currentWeatherName;
private Volume_Weather_types prevWeatherName;
public WindZone windZone;
public List<WeatherEventSM> WeatherEvents = new List<WeatherEventSM>();
public float VolCloudsHorScale = 1000f;
public float VolCloudHeight = 650f;
public float VCloudCoverFac = 1f;
public float VCloudSizeFac = 1f;
public float VCloudCSizeFac = 1f;
public Vector2 VCloudXZOffset = new Vector2(0f, 0f);
public float WindBasedOffsetFactor = 1f;
public Transform VCloudCenter;
public bool VCloudCustomSize;
public bool DefinePlanetScale;
public float PlanetScale = 10000f;
public Transform MapCenter;
public Transform SkyDomeSystem;
public GameObject CloudDomeL1;
public GameObject CloudDomeL2;
public Color Dusk_L1_dome_color = new Color(46f / 51f, 0.83137256f, 0.8862745f, 58f / 85f);
public Color Dusk_L2_dome_color = new Color(0.3529412f, 18f / 85f, 0.10980392f, 58f / 85f);
public Color Dawn_L1_dome_color = new Color(50f / 51f, 38f / 51f, 2f / 3f, 40f / 51f);
public Color Dawn_L2_dome_color = new Color(20f / 51f, 1f / 51f, 1f / 51f, 40f / 51f);
public Color Day_L1_dome_color = new Color(0.9411765f, 0.9411765f, 0.9411765f, 1f);
public Color Day_L2_dome_color = new Color(72f / 85f, 72f / 85f, 72f / 85f, 0.72156864f);
public Color Night_L1_dome_color = new Color(14f / 51f, 14f / 51f, 14f / 51f, 1f);
public Color Night_L2_dome_color = new Color(0.40392157f, 0.40392157f, 0.40392157f, 0.72156864f);
public Color Dark_storm_L2CA = new Color(10f / 51f, 8f / 51f, 8f / 51f, 0.8392157f);
public GameObject StarDome;
public Material CloudDomeL1Mat;
public Material CloudDomeL2Mat;
public float L1CloudCoverOffset;
public float L1CloudDensOffset;
public float L1CloudSize = 1f;
public float L1Ambience = 1f;
public float L12SpeedOffset = 1f;
public Material SnowMat;
public Material SnowMatTerrain;
public float SnowCoverage;
public float SnowCoverageTerrain;
public float SnowCoverageRate = 0.1f;
public float SnowTerrainRate = 0.0001f;
public float SnowTerrRateFactor = 1f;
public float MaxSnowCoverage = 1f;
public string SnowCoverageVariable = "_SnowCoverage";
public GameObject HeavyStormVolumeClouds;
public UnityEngine.Object DustyStormVolumeClouds;
public UnityEngine.Object DayClearVolumeClouds;
public UnityEngine.Object SnowStormVolumeClouds;
public UnityEngine.Object SnowVolumeClouds;
public UnityEngine.Object RainStormVolumeClouds;
public UnityEngine.Object RainVolumeClouds;
public UnityEngine.Object PinkVolumeClouds;
public UnityEngine.Object LightningVolumeClouds;
public float Max_sun_intensity = 1.3f;
public float Min_sun_intensity = 0.01f;
public float To_max_intensity_speed = 0.5f;
public float To_min_intensity_speed = 1.5f;
public bool Ortho_cam;
public float Ortho_factor = -0.46f;
[Range(-3.5f, 1f)]
public float Shift_dawn;
public float Rot_Sun_X;
public float Rot_Sun_Y = 170f;
public float Rot_Sun_Z = 180f;
private float Previous_Rot_Y;
private float Previous_Rot_Z;
private float Previous_Rot_X;
public float Moon_glow = 0.03f;
public float Horizon_adj = 110f;
public float HorizonY = -60f;
public Color GroundColor = Color.grey * 1.4f;
public bool Unity5;
public bool Mobile;
public int Volume_fog_max_part = 150;
public int Snow_cloud_max_part = 1000;
public int Lightning_cloud_max_part = 1000;
public int Real_cloud_max_part = 400;
public int Storm_cloud_max_part = 600;
public int Flat_cloud_max_part = 1500;
public int Refract_Rain_max_part = 300;
public int Snow_max_part = 1200;
public GameObject SunObj;
public GameObject SunObj2;
public Vector3 DualSunsFactors = new Vector3(0.3f, 0.3f, 18f);
[HideInInspector]
public bool alter_sun;
public GameObject MoonObj;
public Transform Hero;
public bool Tag_based_player;
public string Player_tag = "Player";
public Weather_types Weather;
private Weather_types previous_weather;
public bool On_demand;
public Material skyMat;
public Material skyboxMat;
public Material cloud_upMaterial;
public Material cloud_downMaterial;
public Material flat_cloud_upMaterial;
public Material flat_cloud_downMaterial;
public Material cloud_dome_downMaterial;
public Material star_dome_Material;
public Material real_cloud_upMaterial;
public Material real_cloud_downMaterial;
public Material Surround_Clouds_Mat;
public GameObject Sun_Ray_Cloud;
public GameObject Upper_Dynamic_Cloud;
public GameObject Lower_Dynamic_Cloud;
public GameObject Upper_Cloud_Bed;
public GameObject Lower_Cloud_Bed;
public GameObject Upper_Cloud_Real;
public GameObject Lower_Cloud_Real;
public GameObject Upper_Static_Cloud;
public GameObject Lower_Static_Cloud;
public GameObject Cloud_Dome;
public GameObject Surround_Clouds;
public GameObject Surround_Clouds_Heavy;
public GameObject SnowStorm_OBJ;
public bool SnowStorm;
public GameObject[] FallingLeaves_OBJ;
public GameObject Butterfly_OBJ;
public GameObject[] Tornado_OBJs;
public GameObject[] Butterfly3D_OBJ;
public GameObject Ice_Spread_OBJ;
public GameObject Ice_System_OBJ;
public GameObject Lightning_System_OBJ;
public GameObject Lightning_OBJ;
public GameObject Star_particles_OBJ;
public GameObject[] Volcano_OBJ;
public GameObject VolumeFog_OBJ;
public GameObject Rain_Heavy;
public GameObject Rain_Mild;
public bool Use_fog;
public GameObject VolumeRain_Heavy;
public GameObject VolumeRain_Mild;
public GameObject RefractRain_Heavy;
public GameObject RefractRain_Mild;
public bool Fog_local;
public bool Snow_local;
public bool Mild_rain_local;
public bool Heavy_rain_local;
public bool Butterflies_local;
public float m_fExposure = 0.8f;
public Vector3 m_fWaveLength = new Vector3(0.65f, 0.57f, 0.475f);
public float m_ESun = 20f;
public float m_Kr = 0.0025f;
public float m_Km = 0.001f;
public float m_g = -0.99f;
public float scale_dif = 0.25f;
public bool AltScale;
public float OuterRadiusScaleOverInner;
private float m_fInnerRadius;
private float m_fOuterRadius;
public float m_fSamples;
public float m_fRayleighScaleDepth = 0.5f;
public float m_Coloration = 0.28f;
public Color m_TintColor = new Color(0f, 0f, 0f, 0f);
public float fExposureOffset;
public Vector3 fWaveLengthOffset = Vector3.zero;
public float gOffset;
public float scaleDifOffset;
public Vector3 tintColorOffset = Vector3.zero;
public float sunRingFactorOffset;
public bool USE_ORK;
public bool USE_SKYCUBE;
public bool USE_SKYBOX;
public SeasonalTerrainSKYMASTER Terrain_controller;
public SeasonalTerrainSKYMASTER Mesh_Terrain_controller;
public Transform Mesh_terrain;
public Transform Unity_terrain;
public bool LegacySeasonalFX;
public bool Seasonal_change_auto;
private int Season_prev;
public int Season;
public float Seasonal;
public float Seasonal_prev;
public float Horizontal_factor;
public float Horizontal_factor_prev;
public float Sun_ring_factor;
public float Sun_halo_factor;
public float Sun_eclipse_factor;
public float Glob_scale = 1f;
private float mSunSize;
private Vector4 mSunTint;
private float mSkyExponent;
private Vector4 mSkyTopColor;
private Vector4 mSkyMidColor;
private Vector4 mSkyEquatorColor;
private Vector4 mGroundColor;
private float Seasonal_factor1_add;
private float Seasonal_factor2_add;
private float Seasonal_factor3_add;
private float Seasonal_factor4_add;
private float Seasonal_factor5_add;
private float Seasonal_factor6_add;
private float Seasonal_factor7_add;
public float Fog_Density_Speed = 0.5f;
public float Fog_Density_Mult = 1f;
public Color Autumn_fog_day = new Color(0.4f, 0.314f, 0.4f, 1f);
public Color Autumn_fog_dusk = new Color(0.4f, 0.314f, 0.4f, 1f);
public float Autumn_fog_day_density = 0.0001f;
public float Autumn_fog_dusk_density = 0.0002f;
public Color Autumn_fog_night = new Color(0.04f, 0.0314f, 0.04f, 1f);
public float Autumn_fog_night_density = 0.0001f;
public Color Winter_fog_day = new Color(0.45f, 0.45f, 0.45f, 1f);
public Color Winter_fog_dusk = new Color(0.45f, 0.3514f, 0.45f, 1f);
public float Winter_fog_day_density = 0.0002f;
public float Winter_fog_dusk_density = 0.0003f;
public Color Winter_fog_night = new Color(0.045f, 0.03514f, 0.045f, 1f);
public float Winter_fog_night_density = 0.0002f;
public Color Summer_fog_day = new Color(0.5f, 0.5f, 0.5f, 1f);
public Color Summer_fog_dusk = new Color(0.2f, 0.1f, 0.2f, 1f);
public float Summer_fog_day_density = 0.0001f;
public float Summer_fog_dusk_density = 0.0002f;
public Color Summer_fog_night = new Color(0.02f, 0.01f, 0.02f, 1f);
public float Summer_fog_night_density = 0.0001f;
public Color Spring_fog_day = new Color(0.47f, 0.47f, 0.47f, 1f);
public Color Spring_fog_dusk = new Color(0.4f, 0.36f, 0.4f, 1f);
public float Spring_fog_day_density = 0.0001f;
public float Spring_fog_dusk_density = 0.0002f;
public Color Spring_fog_night = new Color(0.01f, 0.01f, 0.01f, 1f);
public float Spring_fog_night_density = 0.0001f;
public Color Tree_Summer_Col = new Color(1f, 0.69f, 0.035f, 1f);
public Color Terrain_Summer_Col = new Color(0.8f, 0.7f, 0.2f, 1f);
public Color Grass_Summer_Col = new Color(1f, 0.71f, 0.004f, 1f);
public Color Tree_Spring_Col = new Color(0.52f, 0.773f, 0.27f, 1f);
public Color Terrain_Spring_Col = new Color(0.17f, 0.247f, 0f, 1f);
public Color Grass_Spring_Col = new Color(0.243f, 0.27f, 0.157f, 1f);
public Color Tree_Winter_Col = new Color(0.028f, 0.028f, 0.028f, 1f);
public Color Terrain_Winter_Col = new Color(0.678f, 0.678f, 0.678f, 1f);
public Color Grass_Winter_Col = new Color(0.028f, 0.028f, 0.028f, 1f);
public Color Tree_Autumn_Col = new Color(0.866f, 0.03f, 0.105f, 1f);
public Color Terrain_Autumn_Col = new Color(0.27f, 0.055f, 0.04f, 1f);
public Color Grass_Autumn_Col = new Color(0.63f, 0.055f, 0.004f, 1f);
public Color Dusk_cloud_color = new Color(1f, 0.4f, 0.2f, 0.5f);
public Color Dusk_real_cloud_col_dn = new Color(1f, 0.61f, 0.55f, 0.17f);
public Color Dusk_real_cloud_col_up = new Color(0.855f, 0.384f, 0.384f, 0.192f);
public Color Dusk_surround_cloud_col = new Color(0.921f, 0.47f, 0.57f, 0.51f);
public Color Night_surround_cloud_col = new Color(0.494f, 0.533f, 1f, 0f);
public Color Dusk_cloud_dome_color = new Color(1f, 0.7f, 0.596f, 0.5f);
public Color Night_Color = new Color(0f, 0f, 0f, 0.1f);
public Color Night_deep_Color = new Color(0f, 0f, 0f, 0.05f);
public Color Night_black_Color = new Color(0f, 0f, 0f, 0f);
public Color Night_lum_Color = new Color(0.05f, 0.05f, 0.05f, 0.7f);
public Color Storm_cloud_Color = new Color(0.1f, 0.1f, 0.1f, 0.5f);
public Color Day_Color = new Color(1f, 1f, 1f, 0.5f);
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 Day_surround_cloud_col = new Color(0.11f, 0.1f, 0.1f, 0.6f);
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);
private bool InitSeason;
private bool init_presets;
private ParticleSystem Star_particles_OBJ_P;
private ParticleSystem[] Butterflies2D_P;
private ParticleSystem[] Butterflies3D_P;
private ParticleSystem[] Dynamic_Clouds_Up_P;
private ParticleSystem[] Dynamic_Clouds_Dn_P;
private ParticleSystem[] Real_Clouds_Up_P;
private ParticleSystem[] Real_Clouds_Dn_P;
private ParticleSystem[] Cloud_bed_Up_P;
private ParticleSystem[] Cloud_bed_Dn_P;
private ParticleSystem[] Cloud_Static_Up_P;
private ParticleSystem[] Cloud_Static_Dn_P;
private ParticleSystem[] Tornados_P;
private ParticleSystem[] Freezer_P;
private ParticleSystem[] SnowStorm_P;
private ParticleSystem[] FallingLeaves_P;
private ParticleSystem[] Volcanos_P;
private ParticleSystem[] VolumeFog_P;
private ParticleSystem[] Surround_Clouds_P;
private ParticleSystem[] Surround_Clouds_Heavy_P;
private ParticleSystem[] Heavy_Rain_P;
private ParticleSystem[] Mild_Rain_P;
private ParticleSystem[] VolumeHeavy_Rain_P;
private ParticleSystem[] VolumeMild_Rain_P;
private ParticleSystem[] RefractHeavy_Rain_P;
private ParticleSystem[] RefractMild_Rain_P;
private ParticleSystem[] Sun_Ray_Cloud_P;
private ParticleSystem[] Lightning_System_P;
private Vector3 InitCam;
public float Cam_follow_factor;
public Vector3 Cam_offset = new Vector3(0f, 0f, 0f);
public GameObject SunTarget;
private float Day_hours = 24f;
[Range(0f, 24f)]
public float Current_Time;
public float Current_Day;
public int Current_Month;
private float days_since_last_month_inc;
public int days_per_month = 30;
private float Keep_previous_time;
private float Keep_previous_dawn_shift;
public bool Auto_Cycle_Sky;
public GameObject SUN_LIGHT;
public GameObject SUPPORT_LIGHT;
public GameObject MOON_LIGHT;
private Vector3 Keep_prev_sun_pos;
public float SPEED = 1f;
public int Preset;
public bool stopRainIfUnderWater;
private Light MAIN;
private GameObject SkyCamOBJ;
public GameObject Test_Cubemap;
private Camera SkyCam;
private Transform SkyCam_transform;
private Cubemap CubeTexture;
public Material CUBE_Mat;
public LayerMask SkyboxLayer;
public bool ReflectSkybox = true;
private float lastReflectTime;
public float ReflectEvery = 0.4f;
public List<Material> AssignCubeMapMats = new List<Material>();
public float ReflectCamfarClip = 6700f;
public bool updateSkyAmbient;
private float lastAmbientUpdateTime;
public float AmbientUpdateEvery = 5f;
public float AmbientIntensity = 1.3f;
private float last_mat_update;
public float Update_mat_every = 0.1f;
private bool cut_off_main_cam;
private Vector3 prev_scene_cam_pos;
private bool init_scene;
public bool LimitSunUpdateRate;
private float last_sun_update;
public float Update_sun_every = 0.01f;
private void LateUpdate()
{
if (Application.isPlaying)
{
for (int i = 0; i < WeatherEvents.Count; i++)
{
if (WeatherEvents[i].is_activated)
{
bool flag = Current_Day >= (float)WeatherEvents[i].EventStartDay && Current_Day <= (float)WeatherEvents[i].EventEndDay;
bool flag2 = true;
bool flag3 = Current_Time >= WeatherEvents[i].EventStartHour && Current_Time <= WeatherEvents[i].EventEndHour;
if (WeatherEvents[i].loop)
{
int num = Current_Month + 1 - Mathf.FloorToInt((Current_Month + 1) / 12) * 12;
flag = WeatherEvents[i].EventStartDay >= (num - 1) * days_per_month && WeatherEvents[i].EventEndDay <= num * days_per_month;
flag2 = num >= WeatherEvents[i].EventStartMonth && num <= WeatherEvents[i].EventEndMonth;
}
if (!flag || !flag3 || !flag2)
{
WeatherEvents[i].is_activated = false;
}
if (currentWeather.VolumeScript != null)
{
currentWeather.VolumeScript.FadeOutOnBoundary = true;
currentWeather.VolumeScript.DestroyOnfadeOut = true;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.HeavyStorm)
{
currentWeatherName = Volume_Weather_types.HeavyStorm;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.Sunny)
{
currentWeatherName = Volume_Weather_types.Sunny;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.Cloudy)
{
currentWeatherName = Volume_Weather_types.Cloudy;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.FlatClouds)
{
currentWeatherName = Volume_Weather_types.FlatClouds;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.Foggy)
{
currentWeatherName = Volume_Weather_types.Foggy;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.FreezeStorm)
{
currentWeatherName = Volume_Weather_types.FreezeStorm;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.HeavyFog)
{
currentWeatherName = Volume_Weather_types.HeavyFog;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.HeavyStormDark)
{
currentWeatherName = Volume_Weather_types.HeavyStormDark;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.LightningStorm)
{
currentWeatherName = Volume_Weather_types.LightningStorm;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.Rain)
{
currentWeatherName = Volume_Weather_types.Rain;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.RollingFog)
{
currentWeatherName = Volume_Weather_types.RollingFog;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.SnowStorm)
{
currentWeatherName = Volume_Weather_types.SnowStorm;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.Tornado)
{
currentWeatherName = Volume_Weather_types.Tornado;
}
if (WeatherEvents[i].FollowUpWeather == WeatherEventSM.Volume_Weather_event_types.VolcanoErupt)
{
currentWeatherName = Volume_Weather_types.VolcanoErupt;
}
}
}
bool flag4 = true;
for (int j = 0; j < WeatherEvents.Count; j++)
{
if (WeatherEvents[j].is_activated)
{
flag4 = false;
}
}
if (flag4)
{
for (int k = 0; k < WeatherEvents.Count; k++)
{
if (WeatherEvents[k].is_activated)
{
continue;
}
bool flag5 = Current_Day >= (float)WeatherEvents[k].EventStartDay && Current_Day <= (float)WeatherEvents[k].EventEndDay;
bool flag6 = true;
bool flag7 = Current_Time >= WeatherEvents[k].EventStartHour && Current_Time <= WeatherEvents[k].EventEndHour;
if (WeatherEvents[k].loop)
{
int num2 = Current_Month + 1 - Mathf.FloorToInt((Current_Month + 1) / 12) * 12;
flag5 = WeatherEvents[k].EventStartDay >= (num2 - 1) * days_per_month && WeatherEvents[k].EventEndDay <= num2 * days_per_month;
flag6 = num2 >= WeatherEvents[k].EventStartMonth && num2 <= WeatherEvents[k].EventEndMonth;
}
if (flag5 && flag7 && flag6)
{
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.HeavyStorm)
{
currentWeatherName = Volume_Weather_types.HeavyStorm;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.Sunny)
{
currentWeatherName = Volume_Weather_types.Sunny;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.Cloudy)
{
currentWeatherName = Volume_Weather_types.Cloudy;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.FlatClouds)
{
currentWeatherName = Volume_Weather_types.FlatClouds;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.Foggy)
{
currentWeatherName = Volume_Weather_types.Foggy;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.FreezeStorm)
{
currentWeatherName = Volume_Weather_types.FreezeStorm;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.HeavyFog)
{
currentWeatherName = Volume_Weather_types.HeavyFog;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.HeavyStormDark)
{
currentWeatherName = Volume_Weather_types.HeavyStormDark;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.LightningStorm)
{
currentWeatherName = Volume_Weather_types.LightningStorm;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.Rain)
{
currentWeatherName = Volume_Weather_types.Rain;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.RollingFog)
{
currentWeatherName = Volume_Weather_types.RollingFog;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.SnowStorm)
{
currentWeatherName = Volume_Weather_types.SnowStorm;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.Tornado)
{
currentWeatherName = Volume_Weather_types.Tornado;
}
if (WeatherEvents[k].Weather_type == WeatherEventSM.Volume_Weather_event_types.VolcanoErupt)
{
currentWeatherName = Volume_Weather_types.VolcanoErupt;
}
VolCloudsHorScale = WeatherEvents[k].VolCloudsHorScale;
WeatherEvents[k].is_activated = true;
break;
}
}
}
if ((currentWeatherName != prevWeatherName) | (currentWeather == null))
{
WeatherSM weatherSM = new WeatherSM();
weatherSM.SkyManager = this;
if (SnowMat != null)
{
weatherSM.SnowMat = SnowMat;
}
if (SnowMatTerrain != null)
{
weatherSM.SnowMatTerrain = SnowMatTerrain;
}
weatherSM.SnowCoverageVariable = SnowCoverageVariable;
weatherSM.windMode = WindZoneMode.Directional;
if ((currentWeatherName == Volume_Weather_types.Sunny) | (currentWeatherName == Volume_Weather_types.VolcanoErupt) | (currentWeatherName == Volume_Weather_types.Foggy) | (currentWeatherName == Volume_Weather_types.HeavyFog) | (currentWeatherName == Volume_Weather_types.RollingFog))
{
weatherSM.Snow = false;
}
if ((currentWeatherName == Volume_Weather_types.Cloudy) | (currentWeatherName == Volume_Weather_types.FlatClouds))
{
weatherSM.has_fog = false;
weatherSM.Snow = false;
Vector3 vector = Vector3.forward;
if (windZone != null)
{
vector = VolCloudsHorScale * windZone.transform.forward;
}
Vector3 position = MapCenter.position;
if (VCloudCenter != null)
{
position = VCloudCenter.position;
}
Vector3 position2 = position + new Vector3(VCloudXZOffset.x, VolCloudHeight, VCloudXZOffset.y) - vector * WindBasedOffsetFactor;
if (DayClearVolumeClouds != null)
{
weatherSM.VolumeCloud = (GameObject)UnityEngine.Object.Instantiate(DayClearVolumeClouds, position2, Quaternion.identity);
VolumeClouds_SM component = weatherSM.VolumeCloud.GetComponent<VolumeClouds_SM>();
if (component != null)
{
if (windZone != null)
{
component.Wind_holder = windZone.gameObject;
}
component.sun_transf = SUN_LIGHT.transform;
component.moon_transf = MOON_LIGHT.transform.parent;
component.SkyManager = this;
if (VCloudCustomSize)
{
component.min_bed_corner = (0f - VolCloudsHorScale) * (20f / WorldScale);
component.max_bed_corner = VolCloudsHorScale * (20f / WorldScale);
}
component.ScaleClouds(WorldScale, VCloudCoverFac, VCloudSizeFac, VCloudCSizeFac);
}
}
}
if (currentWeatherName == Volume_Weather_types.Rain)
{
weatherSM.has_fog = false;
weatherSM.Snow = false;
Vector3 vector2 = Vector3.forward;
if (windZone != null)
{
vector2 = VolCloudsHorScale * windZone.transform.forward;
}
Vector3 position3 = MapCenter.position;
if (VCloudCenter != null)
{
position3 = VCloudCenter.position;
}
Vector3 position4 = position3 + new Vector3(VCloudXZOffset.x, VolCloudHeight, VCloudXZOffset.y) - vector2 * WindBasedOffsetFactor;
if (DayClearVolumeClouds != null)
{
weatherSM.VolumeCloud = (GameObject)UnityEngine.Object.Instantiate(DayClearVolumeClouds, position4, Quaternion.identity);
VolumeClouds_SM component2 = weatherSM.VolumeCloud.GetComponent<VolumeClouds_SM>();
if (component2 != null)
{
if (windZone != null)
{
component2.Wind_holder = windZone.gameObject;
}
component2.sun_transf = SUN_LIGHT.transform;
component2.moon_transf = MOON_LIGHT.transform.parent;
component2.SkyManager = this;
if (VCloudCustomSize)
{
component2.min_bed_corner = (0f - VolCloudsHorScale) * (20f / WorldScale);
component2.max_bed_corner = VolCloudsHorScale * (20f / WorldScale);
}
component2.ScaleClouds(WorldScale, VCloudCoverFac, VCloudSizeFac, VCloudCSizeFac);
}
}
weatherSM.Rain = true;
weatherSM.Refractive_Rain = true;
weatherSM.RefractRainParticle.Add(RefractRain_Heavy.transform);
weatherSM.RefractRainParticleP.Add(RefractHeavy_Rain_P);
}
if ((currentWeatherName == Volume_Weather_types.HeavyStorm) | (currentWeatherName == Volume_Weather_types.HeavyStormDark) | (currentWeatherName == Volume_Weather_types.Tornado) | (currentWeatherName == Volume_Weather_types.LightningStorm))
{
weatherSM.has_fog = true;
weatherSM.Snow = false;
Vector3 vector3 = Vector3.forward;
if (windZone != null)
{
vector3 = VolCloudsHorScale * windZone.transform.forward;
}
Vector3 position5 = MapCenter.position;
if (VCloudCenter != null)
{
position5 = VCloudCenter.position;
}
Vector3 position6 = position5 + new Vector3(VCloudXZOffset.x, VolCloudHeight, VCloudXZOffset.y) - vector3 * WindBasedOffsetFactor;
if (HeavyStormVolumeClouds != null)
{
weatherSM.VolumeCloud = UnityEngine.Object.Instantiate(HeavyStormVolumeClouds, position6, Quaternion.identity);
VolumeClouds_SM component3 = weatherSM.VolumeCloud.GetComponent<VolumeClouds_SM>();
if (component3 != null)
{
if (windZone != null)
{
component3.Wind_holder = windZone.gameObject;
}
component3.sun_transf = SUN_LIGHT.transform;
component3.moon_transf = MOON_LIGHT.transform.parent;
component3.SkyManager = this;
if (VCloudCustomSize)
{
component3.min_bed_corner = (0f - VolCloudsHorScale) * (20f / WorldScale);
component3.max_bed_corner = VolCloudsHorScale * (20f / WorldScale);
}
component3.ScaleClouds(WorldScale, VCloudCoverFac, VCloudSizeFac, VCloudCSizeFac);
}
}
weatherSM.Rain = true;
weatherSM.Refractive_Rain = true;
weatherSM.RefractRainParticle.Add(RefractRain_Heavy.transform);
weatherSM.RefractRainParticleP.Add(RefractHeavy_Rain_P);
}
if ((currentWeatherName == Volume_Weather_types.SnowStorm) | (currentWeatherName == Volume_Weather_types.FreezeStorm))
{
weatherSM.has_fog = true;
weatherSM.Snow = true;
Vector3 vector4 = Vector3.forward;
if (windZone != null)
{
vector4 = VolCloudsHorScale * windZone.transform.forward;
}
Vector3 position7 = MapCenter.position;
if (VCloudCenter != null)
{
position7 = VCloudCenter.position;
}
Vector3 position8 = position7 + new Vector3(VCloudXZOffset.x, VolCloudHeight, VCloudXZOffset.y) - vector4 * WindBasedOffsetFactor;
if (SnowStormVolumeClouds != null)
{
weatherSM.VolumeCloud = (GameObject)UnityEngine.Object.Instantiate(SnowStormVolumeClouds, position8, Quaternion.identity);
VolumeClouds_SM component4 = weatherSM.VolumeCloud.GetComponent<VolumeClouds_SM>();
if (component4 != null)
{
if (windZone != null)
{
component4.Wind_holder = windZone.gameObject;
}
component4.sun_transf = SUN_LIGHT.transform;
component4.moon_transf = MOON_LIGHT.transform.parent;
component4.SkyManager = this;
if (VCloudCustomSize)
{
component4.min_bed_corner = (0f - VolCloudsHorScale) * (20f / WorldScale);
component4.max_bed_corner = VolCloudsHorScale * (20f / WorldScale);
}
component4.ScaleClouds(WorldScale, VCloudCoverFac, VCloudSizeFac, VCloudCSizeFac);
}
}
weatherSM.volume_fog_peset = 7;
weatherSM.Snow = true;
weatherSM.SnowParticle.Add(SnowStorm_OBJ.transform);
weatherSM.SnowParticleP.Add(SnowStorm_P);
}
if (VFogsPerVWeather.Count == 0)
{
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(13);
VFogsPerVWeather.Add(14);
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(7);
VFogsPerVWeather.Add(7);
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(7);
VFogsPerVWeather.Add(7);
VFogsPerVWeather.Add(12);
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(0);
VFogsPerVWeather.Add(14);
}
if (water != null && Terrain_controller != null)
{
if (!(Hero != null) || !(Hero.position.y < water.position.y))
{
if (currentWeatherName == Volume_Weather_types.Sunny)
{
Terrain_controller.FogPreset = VFogsPerVWeather[0];
}
if (currentWeatherName == Volume_Weather_types.Foggy)
{
Terrain_controller.FogPreset = VFogsPerVWeather[1];
}
if (currentWeatherName == Volume_Weather_types.HeavyFog)
{
Terrain_controller.FogPreset = VFogsPerVWeather[2];
}
if (currentWeatherName == Volume_Weather_types.Tornado)
{
Terrain_controller.FogPreset = VFogsPerVWeather[3];
}
if (currentWeatherName == Volume_Weather_types.SnowStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[4];
}
if (currentWeatherName == Volume_Weather_types.FreezeStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[5];
}
if (currentWeatherName == Volume_Weather_types.FlatClouds)
{
Terrain_controller.FogPreset = VFogsPerVWeather[6];
}
if (currentWeatherName == Volume_Weather_types.LightningStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[7];
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[8];
}
if (currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
Terrain_controller.FogPreset = VFogsPerVWeather[9];
}
if (currentWeatherName == Volume_Weather_types.Cloudy)
{
Terrain_controller.FogPreset = VFogsPerVWeather[10];
}
if (currentWeatherName == Volume_Weather_types.RollingFog)
{
Terrain_controller.FogPreset = VFogsPerVWeather[11];
}
if (currentWeatherName == Volume_Weather_types.VolcanoErupt)
{
Terrain_controller.FogPreset = VFogsPerVWeather[12];
}
if (currentWeatherName == Volume_Weather_types.Rain)
{
Terrain_controller.FogPreset = VFogsPerVWeather[13];
}
}
}
else if (Terrain_controller != null)
{
if (currentWeatherName == Volume_Weather_types.Sunny)
{
Terrain_controller.FogPreset = VFogsPerVWeather[0];
}
if (currentWeatherName == Volume_Weather_types.Foggy)
{
Terrain_controller.FogPreset = VFogsPerVWeather[1];
}
if (currentWeatherName == Volume_Weather_types.HeavyFog)
{
Terrain_controller.FogPreset = VFogsPerVWeather[2];
}
if (currentWeatherName == Volume_Weather_types.Tornado)
{
Terrain_controller.FogPreset = VFogsPerVWeather[3];
}
if (currentWeatherName == Volume_Weather_types.SnowStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[4];
}
if (currentWeatherName == Volume_Weather_types.FreezeStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[5];
}
if (currentWeatherName == Volume_Weather_types.FlatClouds)
{
Terrain_controller.FogPreset = VFogsPerVWeather[6];
}
if (currentWeatherName == Volume_Weather_types.LightningStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[7];
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Terrain_controller.FogPreset = VFogsPerVWeather[8];
}
if (currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
Terrain_controller.FogPreset = VFogsPerVWeather[9];
}
if (currentWeatherName == Volume_Weather_types.Cloudy)
{
Terrain_controller.FogPreset = VFogsPerVWeather[10];
}
if (currentWeatherName == Volume_Weather_types.RollingFog)
{
Terrain_controller.FogPreset = VFogsPerVWeather[11];
}
if (currentWeatherName == Volume_Weather_types.VolcanoErupt)
{
Terrain_controller.FogPreset = VFogsPerVWeather[12];
}
if (currentWeatherName == Volume_Weather_types.Rain)
{
Terrain_controller.FogPreset = VFogsPerVWeather[13];
}
}
if (water != null && Mesh_Terrain_controller != null)
{
if (!(Hero != null) || !(Hero.position.y < water.position.y))
{
if (currentWeatherName == Volume_Weather_types.Sunny)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[0];
}
if (currentWeatherName == Volume_Weather_types.Foggy)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[1];
}
if (currentWeatherName == Volume_Weather_types.HeavyFog)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[2];
}
if (currentWeatherName == Volume_Weather_types.Tornado)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[3];
}
if (currentWeatherName == Volume_Weather_types.SnowStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[4];
}
if (currentWeatherName == Volume_Weather_types.FreezeStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[5];
}
if (currentWeatherName == Volume_Weather_types.FlatClouds)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[6];
}
if (currentWeatherName == Volume_Weather_types.LightningStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[7];
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[8];
}
if (currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[9];
}
if (currentWeatherName == Volume_Weather_types.Cloudy)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[10];
}
if (currentWeatherName == Volume_Weather_types.RollingFog)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[11];
}
if (currentWeatherName == Volume_Weather_types.VolcanoErupt)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[12];
}
if (currentWeatherName == Volume_Weather_types.Rain)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[13];
}
}
}
else if (Mesh_Terrain_controller != null)
{
if (currentWeatherName == Volume_Weather_types.Sunny)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[0];
}
if (currentWeatherName == Volume_Weather_types.Foggy)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[1];
}
if (currentWeatherName == Volume_Weather_types.HeavyFog)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[2];
}
if (currentWeatherName == Volume_Weather_types.Tornado)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[3];
}
if (currentWeatherName == Volume_Weather_types.SnowStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[4];
}
if (currentWeatherName == Volume_Weather_types.FreezeStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[5];
}
if (currentWeatherName == Volume_Weather_types.FlatClouds)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[6];
}
if (currentWeatherName == Volume_Weather_types.LightningStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[7];
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[8];
}
if (currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[9];
}
if (currentWeatherName == Volume_Weather_types.Cloudy)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[10];
}
if (currentWeatherName == Volume_Weather_types.RollingFog)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[11];
}
if (currentWeatherName == Volume_Weather_types.VolcanoErupt)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[12];
}
if (currentWeatherName == Volume_Weather_types.Rain)
{
Mesh_Terrain_controller.FogPreset = VFogsPerVWeather[13];
}
}
weatherSM.currentState = WeatherSM.Volume_Weather_State.Init;
prevWeatherName = currentWeatherName;
if (currentWeather != null)
{
if (prevWeather == null)
{
prevWeather = new WeatherSM();
}
currentWeather.currentState = WeatherSM.Volume_Weather_State.FadeOut;
if (currentWeather.VolumeScript != null)
{
currentWeather.VolumeScript.cloned = true;
}
prevWeather = currentWeather;
prevWeather.currentState = WeatherSM.Volume_Weather_State.FadeOut;
}
currentWeather = weatherSM;
}
if (currentWeather != null)
{
if (prevWeather != null)
{
prevWeather.Update();
}
currentWeather.Update();
}
}
else
{
currentWeather = null;
}
}
private void Start()
{
if (StarsMaterial != null)
{
if ((!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
if (Current_Time < 1f)
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.y));
}
else
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.y));
}
}
else if (Current_Time < 1f)
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.x));
}
else
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.x));
}
StarsMaterial.SetFloat("_Light", StarsIntensity);
}
if (ScreenRainDrops && RainDropsPlane != null && ScreenRainDropsMat != null)
{
if ((currentWeatherName == Volume_Weather_types.HeavyStorm) | (currentWeatherName == Volume_Weather_types.HeavyStormDark) | (currentWeatherName == Volume_Weather_types.Rain))
{
if (ScreenFreezeFX)
{
ScreenRainDropsMat.SetFloat("_Speed", 0f);
ScreenRainDropsMat.SetFloat("_WaterAmount", MaxWater);
ScreenRainDropsMat.SetFloat("_BumpAmt", MaxRefract * 4f);
if (FreezeInwards)
{
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", 0f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", 0f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", 1f);
}
else
{
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", 1f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", 1f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", 0f);
}
}
else
{
ScreenRainDropsMat.SetFloat("_Speed", MaxDropSpeed);
ScreenRainDropsMat.SetFloat("_WaterAmount", MaxWater);
ScreenRainDropsMat.SetFloat("_BumpAmt", MaxRefract);
}
}
else if (ScreenFreezeFX | (currentWeatherName == Volume_Weather_types.FreezeStorm))
{
ScreenRainDropsMat.SetFloat("_Speed", 0f);
ScreenRainDropsMat.SetFloat("_WaterAmount", MaxWater);
ScreenRainDropsMat.SetFloat("_BumpAmt", MaxRefract * 4f);
if (FreezeInwards)
{
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", 0f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", 0f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", 1f);
}
else
{
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", 1f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", 1f);
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", 0f);
}
}
else
{
ScreenRainDropsMat.SetFloat("_WaterAmount", 0f);
ScreenRainDropsMat.SetFloat("_BumpAmt", 0f);
}
}
if (MoonPhases && MoonPhasesMat != null)
{
Moon_glow = 0.43f;
}
Color a = Color.white;
Color a2 = Color.white;
float a3 = 0f;
float a4 = 0f;
Color a5 = Color.white;
Color a6 = Color.white;
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
a = CloudDomeL1Mat.GetVector("_Color");
a2 = CloudDomeL2Mat.GetVector("_Color");
a3 = CloudDomeL1Mat.GetFloat("_CloudCover");
a4 = CloudDomeL2Mat.GetFloat("_CloudCover");
a5 = CloudDomeL1Mat.GetVector("_Ambient");
a6 = CloudDomeL2Mat.GetVector("_Ambient");
CloudDomeL1Mat.SetFloat("_CloudDensity", L1CloudDensOffset);
CloudDomeL1Mat.SetFloat("_CloudSize", L1CloudSize);
CloudDomeL1Mat.SetFloat("_AmbientFactor", L1Ambience);
if (windZone != null)
{
Vector3 forward = new Vector3(windZone.transform.forward.x, 0f, windZone.transform.forward.z);
CloudDomeL1.transform.forward = forward;
}
}
if (currentWeatherName == Volume_Weather_types.Sunny)
{
Shader.SetGlobalFloat(SnowCoverageVariable, 0f);
if (SnowMatTerrain != null)
{
SnowMatTerrain.SetFloat(SnowCoverageVariable, 0f);
}
}
float num = 0.8f;
float num2 = 1f;
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color2 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color3 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a, num2 * new Color(color.r, color.g, color.b, num), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a2, num2 * new Color(color3.r, color3.g, color3.b, num), 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a3, 1.09f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a4, 1.08f, 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a5, num2 * new Color(color2.r, color2.g, color2.b, num * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a6, num2 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a, num2 * new Color(Day_L1_dome_color.r, Day_L1_dome_color.g, Day_L1_dome_color.b, num), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a2, num2 * new Color(Day_L2_dome_color.r, Day_L2_dome_color.g, Day_L2_dome_color.b, num), 0.15f * Time.deltaTime));
if (currentWeatherName == Volume_Weather_types.Sunny)
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a3, 0f, 1f));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a4, 0f, 1f));
}
else
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a3, 0.82f + L1CloudCoverOffset, 1f));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a4, 0f, 1f));
}
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a, num2 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a2, num2 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a, num2 * new Color(Day_L1_dome_color.r, Day_L1_dome_color.g, Day_L1_dome_color.b, num), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a2, num2 * new Color(Day_L2_dome_color.r, Day_L2_dome_color.g, Day_L2_dome_color.b, num), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a3, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a4, 0.693f, 0.5f * Time.deltaTime));
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a5, num2 * new Color(Day_L1_dome_color.r, Day_L1_dome_color.g, Day_L1_dome_color.b, num * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a6, num2 * new Color(Day_L2_dome_color.r, Day_L2_dome_color.g, Day_L2_dome_color.b, num), 0.15f * Time.deltaTime));
}
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Shader.SetGlobalFloat(SnowCoverageVariable, SnowCoverage);
if (SnowMatTerrain != null)
{
SnowMatTerrain.SetFloat(SnowCoverageVariable, SnowCoverageTerrain / divideSnowTerrain);
}
}
currentWeather = null;
InitSeason = false;
if (Terrain.activeTerrain != null)
{
Terrain_controller = Terrain.activeTerrain.gameObject.GetComponent(typeof(SeasonalTerrainSKYMASTER)) as SeasonalTerrainSKYMASTER;
}
if (Mesh_terrain != null)
{
Mesh_Terrain_controller = Mesh_terrain.gameObject.GetComponent(typeof(SeasonalTerrainSKYMASTER)) as SeasonalTerrainSKYMASTER;
}
float num3 = base.transform.localScale.x;
if (DefinePlanetScale)
{
num3 = PlanetScale;
}
m_fInnerRadius = num3;
OuterRadiusScaleOverInner = 1f + scale_dif / 10f;
m_fOuterRadius = OuterRadiusScaleOverInner * num3;
_ = USE_ORK;
if (SUN_LIGHT != null)
{
MAIN = SUN_LIGHT.GetComponent("Light") as Light;
}
else
{
Debug.Log("Please add a light to the 'SUN_LIGHT' variable");
}
Keep_previous_time = Current_Time;
Keep_previous_dawn_shift = Shift_dawn;
Previous_Rot_Y = Rot_Sun_Y;
Previous_Rot_Z = Rot_Sun_Z;
Previous_Rot_X = Rot_Sun_X;
if (USE_SKYCUBE)
{
CubeTexture = new Cubemap(256, TextureFormat.ARGB32, mipChain: false);
CUBE_Mat.SetTexture("_Tex", CubeTexture);
if (SkyDomeSystem != null)
{
RenderSettings.skybox = CUBE_Mat;
}
}
if (Butterfly_OBJ != null)
{
Butterfly_OBJ.SetActive(value: true);
Component[] componentsInChildren = Butterfly_OBJ.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren != null)
{
Butterflies2D_P = new ParticleSystem[componentsInChildren.Length];
for (int i = 0; i < componentsInChildren.Length; i++)
{
Butterflies2D_P[i] = componentsInChildren[i].GetComponent<ParticleSystem>();
}
}
Butterfly_OBJ.SetActive(value: false);
}
if (Upper_Dynamic_Cloud != null)
{
Upper_Dynamic_Cloud.SetActive(value: true);
Component[] componentsInChildren2 = Upper_Dynamic_Cloud.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren2 != null)
{
Dynamic_Clouds_Up_P = new ParticleSystem[componentsInChildren2.Length];
for (int j = 0; j < componentsInChildren2.Length; j++)
{
Dynamic_Clouds_Up_P[j] = componentsInChildren2[j].GetComponent<ParticleSystem>();
}
}
Upper_Dynamic_Cloud.SetActive(value: false);
}
if (Lower_Dynamic_Cloud != null)
{
Lower_Dynamic_Cloud.SetActive(value: true);
Component[] componentsInChildren3 = Lower_Dynamic_Cloud.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren3 != null)
{
Dynamic_Clouds_Dn_P = new ParticleSystem[componentsInChildren3.Length];
for (int k = 0; k < componentsInChildren3.Length; k++)
{
Dynamic_Clouds_Dn_P[k] = componentsInChildren3[k].GetComponent<ParticleSystem>();
}
}
Lower_Dynamic_Cloud.SetActive(value: false);
}
if (Lower_Cloud_Real != null)
{
Lower_Cloud_Real.SetActive(value: true);
Component[] componentsInChildren4 = Lower_Cloud_Real.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren4 != null)
{
Real_Clouds_Dn_P = new ParticleSystem[componentsInChildren4.Length];
for (int l = 0; l < componentsInChildren4.Length; l++)
{
Real_Clouds_Dn_P[l] = componentsInChildren4[l].GetComponent<ParticleSystem>();
}
}
Lower_Cloud_Real.SetActive(value: false);
}
if (Upper_Cloud_Real != null)
{
Upper_Cloud_Real.SetActive(value: true);
Component[] componentsInChildren5 = Upper_Cloud_Real.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren5 != null)
{
Real_Clouds_Up_P = new ParticleSystem[componentsInChildren5.Length];
for (int m = 0; m < componentsInChildren5.Length; m++)
{
Real_Clouds_Up_P[m] = componentsInChildren5[m].GetComponent<ParticleSystem>();
}
}
Upper_Cloud_Real.SetActive(value: false);
}
if (Lower_Cloud_Bed != null)
{
Lower_Cloud_Bed.SetActive(value: true);
Component[] componentsInChildren6 = Lower_Cloud_Bed.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren6 != null)
{
Cloud_bed_Dn_P = new ParticleSystem[componentsInChildren6.Length];
for (int n = 0; n < componentsInChildren6.Length; n++)
{
Cloud_bed_Dn_P[n] = componentsInChildren6[n].GetComponent<ParticleSystem>();
}
}
Lower_Cloud_Bed.SetActive(value: false);
}
if (Upper_Cloud_Bed != null)
{
Upper_Cloud_Bed.SetActive(value: true);
Component[] componentsInChildren7 = Upper_Cloud_Bed.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren7 != null)
{
Cloud_bed_Up_P = new ParticleSystem[componentsInChildren7.Length];
for (int num4 = 0; num4 < componentsInChildren7.Length; num4++)
{
Cloud_bed_Up_P[num4] = componentsInChildren7[num4].GetComponent<ParticleSystem>();
}
}
Upper_Cloud_Bed.SetActive(value: false);
}
if (Lower_Static_Cloud != null)
{
Lower_Static_Cloud.SetActive(value: true);
Component[] componentsInChildren8 = Lower_Static_Cloud.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren8 != null)
{
Cloud_Static_Dn_P = new ParticleSystem[componentsInChildren8.Length];
for (int num5 = 0; num5 < componentsInChildren8.Length; num5++)
{
Cloud_Static_Dn_P[num5] = componentsInChildren8[num5].GetComponent<ParticleSystem>();
}
}
Lower_Static_Cloud.SetActive(value: false);
}
if (Upper_Static_Cloud != null)
{
Upper_Static_Cloud.SetActive(value: true);
Component[] componentsInChildren9 = Upper_Static_Cloud.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren9 != null)
{
Cloud_Static_Up_P = new ParticleSystem[componentsInChildren9.Length];
for (int num6 = 0; num6 < componentsInChildren9.Length; num6++)
{
Cloud_Static_Up_P[num6] = componentsInChildren9[num6].GetComponent<ParticleSystem>();
}
}
Upper_Static_Cloud.SetActive(value: false);
}
if (Surround_Clouds != null)
{
Surround_Clouds.SetActive(value: true);
Component[] componentsInChildren10 = Surround_Clouds.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren10 != null)
{
Surround_Clouds_P = new ParticleSystem[componentsInChildren10.Length];
for (int num7 = 0; num7 < componentsInChildren10.Length; num7++)
{
Surround_Clouds_P[num7] = componentsInChildren10[num7].GetComponent<ParticleSystem>();
}
}
Surround_Clouds.SetActive(value: false);
}
if (Surround_Clouds_Heavy != null)
{
Surround_Clouds_Heavy.SetActive(value: true);
Component[] componentsInChildren11 = Surround_Clouds_Heavy.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren11 != null)
{
Surround_Clouds_Heavy_P = new ParticleSystem[componentsInChildren11.Length];
for (int num8 = 0; num8 < componentsInChildren11.Length; num8++)
{
Surround_Clouds_Heavy_P[num8] = componentsInChildren11[num8].GetComponent<ParticleSystem>();
}
}
Surround_Clouds_Heavy.SetActive(value: false);
}
if (Tornado_OBJs != null)
{
Tornados_P = new ParticleSystem[Tornado_OBJs.Length];
for (int num9 = 0; num9 < Tornado_OBJs.Length; num9++)
{
Tornado_OBJs[num9].SetActive(value: true);
Component component = Tornado_OBJs[num9].GetComponent(typeof(ParticleSystem));
if (component != null)
{
Tornados_P[num9] = component.GetComponent<ParticleSystem>();
}
Tornado_OBJs[num9].SetActive(value: false);
}
}
if (Ice_Spread_OBJ != null)
{
Ice_Spread_OBJ.SetActive(value: true);
Component[] componentsInChildren12 = Ice_Spread_OBJ.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren12 != null)
{
Freezer_P = new ParticleSystem[componentsInChildren12.Length];
for (int num10 = 0; num10 < componentsInChildren12.Length; num10++)
{
Freezer_P[num10] = componentsInChildren12[num10].GetComponent<ParticleSystem>();
}
}
Ice_Spread_OBJ.SetActive(value: false);
}
if (SnowStorm_OBJ != null)
{
SnowStorm_OBJ.SetActive(value: true);
Component[] componentsInChildren13 = SnowStorm_OBJ.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren13 != null)
{
SnowStorm_P = new ParticleSystem[componentsInChildren13.Length];
for (int num11 = 0; num11 < componentsInChildren13.Length; num11++)
{
SnowStorm_P[num11] = componentsInChildren13[num11].GetComponent<ParticleSystem>();
}
}
SnowStorm_OBJ.SetActive(value: false);
}
if (VolumeFog_OBJ != null)
{
VolumeFog_OBJ.SetActive(value: true);
Component[] componentsInChildren14 = VolumeFog_OBJ.GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren14 != null)
{
VolumeFog_P = new ParticleSystem[componentsInChildren14.Length];
for (int num12 = 0; num12 < componentsInChildren14.Length; num12++)
{
VolumeFog_P[num12] = componentsInChildren14[num12].GetComponent<ParticleSystem>();
}
}
VolumeFog_OBJ.SetActive(value: false);
}
if (FallingLeaves_OBJ != null)
{
FallingLeaves_P = new ParticleSystem[FallingLeaves_OBJ.Length];
for (int num13 = 0; num13 < FallingLeaves_OBJ.Length; num13++)
{
FallingLeaves_OBJ[num13].SetActive(value: true);
Component component2 = FallingLeaves_OBJ[num13].GetComponent(typeof(ParticleSystem));
if (component2 != null)
{
FallingLeaves_P[num13] = component2.GetComponent<ParticleSystem>();
}
FallingLeaves_OBJ[num13].SetActive(value: false);
}
}
if (Butterfly3D_OBJ != null && Butterfly3D_OBJ.Length != 0)
{
Butterfly3D_OBJ[0].SetActive(value: true);
Component[] componentsInChildren15 = Butterfly3D_OBJ[0].GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren15 != null)
{
Butterflies3D_P = new ParticleSystem[componentsInChildren15.Length];
for (int num14 = 0; num14 < componentsInChildren15.Length; num14++)
{
Butterflies3D_P[num14] = componentsInChildren15[num14].GetComponent<ParticleSystem>();
}
}
Butterfly3D_OBJ[0].SetActive(value: false);
}
if (Volcano_OBJ != null)
{
Volcanos_P = new ParticleSystem[Volcano_OBJ.Length * 5];
int num15 = 0;
for (int num16 = 0; num16 < Volcano_OBJ.Length; num16++)
{
Volcano_OBJ[num16].SetActive(value: true);
Component[] componentsInChildren16 = Volcano_OBJ[num16].GetComponentsInChildren(typeof(ParticleSystem));
if (componentsInChildren16 != null)
{
Volcanos_P[num15] = componentsInChildren16[0].GetComponent<ParticleSystem>();
Volcanos_P[num15 + 1] = componentsInChildren16[1].GetComponent<ParticleSystem>();
Volcanos_P[num15 + 2] = componentsInChildren16[2].GetComponent<ParticleSystem>();
Volcanos_P[num15 + 3] = componentsInChildren16[3].GetComponent<ParticleSystem>();
Volcanos_P[num15 + 4] = componentsInChildren16[4].GetComponent<ParticleSystem>();
num15 += 5;
}
Volcano_OBJ[num16].SetActive(value: false);
}
}
Heavy_Rain_P = new ParticleSystem[1];
Mild_Rain_P = new ParticleSystem[1];
Sun_Ray_Cloud_P = new ParticleSystem[1];
Lightning_System_P = new ParticleSystem[1];
if (Rain_Heavy != null)
{
Heavy_Rain_P = Rain_Heavy.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (VolumeRain_Heavy != null)
{
VolumeHeavy_Rain_P = VolumeRain_Heavy.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (VolumeRain_Mild != null)
{
VolumeMild_Rain_P = VolumeRain_Mild.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (RefractRain_Heavy != null)
{
RefractHeavy_Rain_P = RefractRain_Heavy.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (RefractRain_Mild != null)
{
RefractMild_Rain_P = RefractRain_Mild.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (Rain_Mild != null)
{
Mild_Rain_P = Rain_Mild.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (Sun_Ray_Cloud != null)
{
Sun_Ray_Cloud_P = Sun_Ray_Cloud.GetComponentsInChildren<ParticleSystem>(includeInactive: true);
}
if (Star_particles_OBJ != null)
{
Star_particles_OBJ_P = Star_particles_OBJ.GetComponentInChildren(typeof(ParticleSystem)) as ParticleSystem;
}
if (Lightning_System_OBJ != null)
{
Lightning_System_OBJ.SetActive(value: true);
Component[] componentsInChildren17 = Lightning_System_OBJ.GetComponentsInChildren(typeof(ParticleSystem));
if ((componentsInChildren17 != null) & (componentsInChildren17.Length != 0))
{
Lightning_System_P[0] = componentsInChildren17[0].GetComponent<ParticleSystem>();
}
Lightning_System_OBJ.SetActive(value: false);
}
if (Tag_based_player)
{
if (Hero == null && GameObject.FindGameObjectWithTag(Player_tag) != null)
{
Hero = GameObject.FindGameObjectWithTag(Player_tag).transform;
}
}
else if (Hero == null)
{
Hero = Camera.main.transform;
}
if ((Hero != null) & Application.isPlaying)
{
if (Butterflies_local && Butterfly_OBJ != null)
{
Butterfly_OBJ.transform.parent = Hero;
Butterfly_OBJ.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (Fog_local && VolumeFog_OBJ != null)
{
VolumeFog_OBJ.transform.parent = Hero;
VolumeFog_OBJ.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (Heavy_rain_local)
{
if (Rain_Heavy != null)
{
Rain_Heavy.transform.parent = Hero;
Rain_Heavy.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (VolumeRain_Heavy != null)
{
VolumeRain_Heavy.transform.parent = Hero;
VolumeRain_Heavy.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (RefractRain_Heavy != null)
{
RefractRain_Heavy.transform.parent = Hero;
RefractRain_Heavy.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
}
if (Mild_rain_local)
{
if (Rain_Mild != null)
{
Rain_Mild.transform.parent = Hero;
Rain_Mild.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (VolumeRain_Mild != null)
{
VolumeRain_Mild.transform.parent = Hero;
VolumeRain_Mild.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (RefractRain_Mild != null)
{
RefractRain_Mild.transform.parent = Hero;
RefractRain_Mild.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
}
if (Snow_local)
{
if (SnowStorm_OBJ != null)
{
SnowStorm_OBJ.transform.parent = Hero;
SnowStorm_OBJ.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
if (Ice_Spread_OBJ != null)
{
Ice_Spread_OBJ.transform.parent = Hero;
Ice_Spread_OBJ.transform.position = new Vector3(Hero.position.x, Hero.position.y + RainDistAboveHero, Hero.position.z);
}
}
}
InitCam = new Vector3(62.67624f, 10016f, 107.306f);
Update();
Run_presets();
if (!Seasonal_change_auto & !On_demand)
{
if ((Season == 0) | (Season == 1))
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color spring_fog_day = Spring_fog_day;
float num17 = Spring_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
spring_fog_day = Spring_fog_day;
num17 = Spring_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
spring_fog_day = Spring_fog_night;
num17 = Spring_fog_night_density * Fog_Density_Mult;
}
else
{
spring_fog_day = Spring_fog_dusk;
num17 = Spring_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode = fogMode;
float fog_Density_Speed = Fog_Density_Speed;
Make_Fog_Appear(spring_fog_day, num17, mode, fog_Density_Speed, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 2)
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color summer_fog_day = Summer_fog_day;
float num18 = Summer_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
summer_fog_day = Summer_fog_day;
num18 = Summer_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
summer_fog_day = Summer_fog_night;
num18 = Summer_fog_night_density * Fog_Density_Mult;
}
else
{
summer_fog_day = Summer_fog_dusk;
num18 = Summer_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode2 = fogMode;
float fog_Density_Speed2 = Fog_Density_Speed;
Make_Fog_Appear(summer_fog_day, num18, mode2, fog_Density_Speed2, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 3)
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color autumn_fog_day = Autumn_fog_day;
float num19 = Autumn_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
autumn_fog_day = Autumn_fog_day;
num19 = Autumn_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
autumn_fog_day = Autumn_fog_night;
num19 = Autumn_fog_night_density * Fog_Density_Mult;
}
else
{
autumn_fog_day = Autumn_fog_dusk;
num19 = Autumn_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode3 = fogMode;
float fog_Density_Speed3 = Fog_Density_Speed;
Make_Fog_Appear(autumn_fog_day, num19, mode3, fog_Density_Speed3, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 4)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color winter_fog_day = Winter_fog_day;
float num20 = Winter_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
winter_fog_day = Winter_fog_day;
num20 = Winter_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
winter_fog_day = Winter_fog_night;
num20 = Winter_fog_night_density * Fog_Density_Mult;
}
else
{
winter_fog_day = Winter_fog_dusk;
num20 = Winter_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode4 = fogMode;
float fog_Density_Speed4 = Fog_Density_Speed;
Make_Fog_Appear(winter_fog_day, num20, mode4, fog_Density_Speed4, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
init_presets = true;
Horizontal_factor = 0f;
Horizontal_factor_prev = 0f;
if (Shift_dawn != 0f)
{
SunSystem.transform.eulerAngles = new Vector3(28.1412f - (Current_Time - 20.5f) * 15f + Shift_dawn * 15f, Rot_Sun_Y, Rot_Sun_Z);
}
else
{
SunSystem.transform.eulerAngles = new Vector3(Mathf.Abs(748.1412f - (Current_Time - 20.5f) * 15f), Rot_Sun_Y, Rot_Sun_Z);
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
SnowCoverage = MaxSnowCoverage;
SnowCoverageTerrain = MaxSnowCoverage;
Shader.SetGlobalFloat(SnowCoverageVariable, MaxSnowCoverage / divideSnowTerrain);
if (SnowMatTerrain != null)
{
SnowMatTerrain.SetFloat(SnowCoverageVariable, MaxSnowCoverage / divideSnowTerrain);
}
}
else
{
SnowCoverage = 0f;
SnowCoverageTerrain = 0f;
Shader.SetGlobalFloat(SnowCoverageVariable, 0f);
if (SnowMatTerrain != null)
{
SnowMatTerrain.SetFloat(SnowCoverageVariable, 0f);
}
}
if (updateSkyAmbient)
{
DynamicGI.UpdateEnvironment();
lastAmbientUpdateTime = Time.fixedTime;
RenderSettings.ambientMode = AmbientMode.Skybox;
RenderSettings.ambientIntensity = AmbientIntensity;
}
if (skyMat != null && Camera.main != null)
{
Assign_Material_Props(skyMat, Camera.main.transform.position);
Assign_Material_PropsS(skyMat, Camera.main.transform.position);
}
init_scene = false;
if (Camera.main != null)
{
prev_scene_cam_pos = Camera.main.transform.position;
}
if (skyboxMat != null && Camera.main != null)
{
Assign_Material_Props(skyboxMat, Camera.main.transform.position);
Assign_Material_PropsS(skyboxMat, Camera.main.transform.position);
}
}
private void Awake()
{
init_scene = false;
if (Camera.main != null)
{
prev_scene_cam_pos = Camera.main.transform.position;
}
}
private void OnApplicationQuit()
{
init_scene = false;
if (Camera.main != null)
{
prev_scene_cam_pos = Camera.main.transform.position;
}
if (skyMat != null && Camera.main != null)
{
Assign_Material_Props(skyMat, Camera.main.transform.position);
Assign_Material_PropsS(skyMat, Camera.main.transform.position);
}
if (skyboxMat != null && Camera.main != null)
{
Assign_Material_Props(skyboxMat, Camera.main.transform.position);
Assign_Material_PropsS(skyboxMat, Camera.main.transform.position);
}
}
private void Assign_Material_PropsS(Material mat, Vector3 CameraTransform)
{
if (USE_SKYCUBE && SkyDomeSystem != null)
{
mat.SetVector("v3CameraPos", SkyCam_transform.localPosition);
}
else if (Unity5)
{
InitCam = new Vector3(62.67624f, 10016f, 107.306f);
Vector3 vector = CameraTransform;
if (Application.isPlaying)
{
mat.SetVector("v3CameraPos", new Vector3(0f, 14f, 0f) - InitCam + Cam_offset + Cam_follow_factor * new Vector3(0f, (SunTarget.transform.position.y - vector.y) / 200f));
}
else
{
mat.SetVector("v3CameraPos", new Vector3(0f, 14f, 0f) - InitCam + Cam_offset + Cam_follow_factor * new Vector3(0f, (SunTarget.transform.position.y - vector.y) / 200f));
}
}
else
{
mat.SetVector("v3CameraPos", base.transform.localPosition);
}
}
private void Assign_Material_Props(Material mat, Vector3 CameraTransform)
{
if (Camera.main != null && CameraTransform != Camera.main.transform.position)
{
return;
}
Vector3 vector = new Vector3(1f / Mathf.Pow(m_fWaveLength.x, 4f), 1f / Mathf.Pow(m_fWaveLength.y, 4f), 1f / Mathf.Pow(m_fWaveLength.z, 4f));
float num = 1f;
num = 1f / (m_fOuterRadius - m_fInnerRadius) * Glob_scale;
float value = m_Kr * 4f * MathF.PI;
float value2 = m_Km * 4f * MathF.PI;
Vector3 vector2 = CameraTransform;
_ = (Camera.current != null) & Application.isEditor;
float num2 = Horizon_adj + 96f * (SunTarget.transform.position.y - vector2.y) / 3000f;
mat.SetFloat("Horizon_adj", num2 * 0.1f);
mat.SetFloat("HorizonY", HorizonY / 1000f);
mat.SetColor("GroundColor", GroundColor);
if (Ortho_cam)
{
mat.SetColor("_Obliqueness", new Vector4(Ortho_factor, 0f, 0f, 0f));
}
else
{
mat.SetColor("_Obliqueness", new Vector4(0f, 0f, 0f, 0f));
}
if (!alter_sun)
{
bool num3 = !AutoSunPosition && ((Current_Time > NightTimeMax + Shift_dawn && Current_Time <= 25f) || (Current_Time >= 0f && Current_Time < 9f + Shift_dawn));
bool flag = AutoSunPosition && Rot_Sun_X <= NightAngleMax;
if (num3 || flag)
{
mat.SetVector("v3LightDir", Vector3.one * Sun_ring_factor - (CameraTransform - MoonObj.transform.position).normalized);
}
else if (!Application.isPlaying || (Application.isPlaying && Time.fixedTime > 0.01f))
{
mat.SetVector("v3LightDir", Vector3.one * Sun_ring_factor - (CameraTransform - SunObj.transform.position).normalized);
}
if (SunObj2 != null)
{
mat.SetVector("DualSunsFactors", DualSunsFactors);
mat.SetVector("v3LightDirMoon", Vector3.one * Sun_ring_factor - (CameraTransform - SunObj2.transform.position).normalized);
}
}
mat.SetVector("v3InvWavelength", vector);
mat.SetFloat("_Coloration", m_Coloration);
mat.SetVector("_TintColor", m_TintColor);
mat.SetFloat("fInnerRadius", m_fInnerRadius);
mat.SetFloat("fInnerRadius2", m_fInnerRadius * m_fInnerRadius);
mat.SetFloat("fOuterRadius", m_fOuterRadius);
mat.SetFloat("fOuterRadius2", m_fOuterRadius * m_fOuterRadius);
mat.SetFloat("fKrESun", m_Kr * m_ESun - 10f * Sun_halo_factor);
mat.SetFloat("fKmESun", m_Km * m_ESun - 10f * Sun_eclipse_factor);
mat.SetFloat("fKr4PI", value);
mat.SetFloat("fKm4PI", value2);
mat.SetFloat("fScale", num);
if (!AltScale)
{
mat.SetFloat("fScaleDepth", scale_dif);
}
else
{
mat.SetFloat("fScaleDepth", m_fRayleighScaleDepth);
}
mat.SetFloat("fScaleOverScaleDepth", num / m_fRayleighScaleDepth);
mat.SetFloat("fExposure", m_fExposure);
mat.SetFloat("g", m_g);
mat.SetFloat("g2", m_g * m_g);
mat.SetFloat("fSamples", m_fSamples);
if (USE_SKYBOX)
{
mat.SetFloat("_SunSize", mSunSize);
mat.SetVector("_SunTint", mSunTint);
mat.SetFloat("_SkyExponent", mSkyExponent);
mat.SetVector("_SkyTopColor", mSkyTopColor);
mat.SetVector("_SkyMidColor", mSkyMidColor);
mat.SetVector("_SkyEquatorColor", mSkyEquatorColor);
mat.SetVector("_GroundColor", mGroundColor);
}
}
private void Make_Fog_Dissappear(float speed)
{
if (RenderSettings.fog)
{
RenderSettings.fogDensity = Mathf.Lerp(RenderSettings.fogDensity, 0f, speed * Time.deltaTime);
}
}
private void Make_Fog_Appear(Color Fog_Color, float density, FogMode mode, float speed, int Season)
{
float num = 255f;
if (true)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
RenderSettings.fogDensity = 0f;
}
if (Season != 0 && Season == 3)
{
Fog_Color = new Color(100f / num, 80f / num, 100f / num, 255f / num);
density = 0.01f;
mode = FogMode.ExponentialSquared;
}
Color color = Fog_Color;
if (init_presets)
{
RenderSettings.fogColor = Color.Lerp(RenderSettings.fogColor, color, speed * Time.deltaTime);
RenderSettings.fogDensity = Mathf.Lerp(RenderSettings.fogDensity, density, speed * Time.deltaTime);
RenderSettings.fogMode = mode;
}
else
{
RenderSettings.fogColor = color;
RenderSettings.fogDensity = density;
RenderSettings.fogMode = mode;
}
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
private void Make_Appear(GameObject Particle_OBJ, ParticleSystem[] ParticleOBJ_Ps, ParticleSystem ParticleOBJ_P, int max_particles, bool reset_pcount, int rate)
{
if (!(Particle_OBJ != null))
{
return;
}
if (!Particle_OBJ.activeInHierarchy)
{
Particle_OBJ.SetActive(value: true);
if (ParticleOBJ_Ps != null)
{
for (int i = 0; i < ParticleOBJ_Ps.Length; i++)
{
ParticleSystem.MainModule main = ParticleOBJ_Ps[i].main;
ParticleOBJ_Ps[i].Stop();
ParticleOBJ_Ps[i].Clear();
if (reset_pcount)
{
main.maxParticles = 0;
}
}
}
if (ParticleOBJ_P != null)
{
ParticleOBJ_P.Stop();
ParticleOBJ_P.Clear();
if (reset_pcount)
{
ParticleSystem.MainModule main2 = ParticleOBJ_P.main;
main2.maxParticles = 0;
}
}
return;
}
if (reset_pcount)
{
if (ParticleOBJ_Ps != null)
{
for (int j = 0; j < ParticleOBJ_Ps.Length; j++)
{
ParticleSystem.MainModule main3 = ParticleOBJ_Ps[j].main;
if (main3.maxParticles < max_particles)
{
main3.maxParticles += rate;
}
if (!ParticleOBJ_Ps[j].isPlaying)
{
ParticleOBJ_Ps[j].Play();
}
}
}
if (ParticleOBJ_P != null)
{
ParticleSystem.MainModule main4 = ParticleOBJ_P.main;
if (main4.maxParticles < max_particles)
{
main4.maxParticles += rate;
}
if (!ParticleOBJ_P.isPlaying)
{
ParticleOBJ_P.Play();
}
}
return;
}
if (ParticleOBJ_Ps != null)
{
for (int k = 0; k < ParticleOBJ_Ps.Length; k++)
{
ParticleSystem.MainModule main5 = ParticleOBJ_Ps[k].main;
main5.maxParticles = max_particles;
ParticleOBJ_Ps[k].Play();
}
}
if (ParticleOBJ_P != null)
{
ParticleSystem.MainModule main6 = ParticleOBJ_P.main;
main6.maxParticles = max_particles;
ParticleOBJ_P.Play();
}
}
private void Make_Dissappear(GameObject Particle_OBJ, ParticleSystem[] ParticleOBJ_Ps, ParticleSystem ParticleOBJ_P, int min_particles, int rate, bool pull_downward, bool on_lowest)
{
if (!(Particle_OBJ != null) || !Particle_OBJ.activeInHierarchy)
{
return;
}
if (ParticleOBJ_Ps != null)
{
int num = 0;
for (int i = 0; i < ParticleOBJ_Ps.Length; i++)
{
ParticleSystem.MainModule main = ParticleOBJ_Ps[i].main;
main.maxParticles -= rate;
if (pull_downward)
{
main.gravityModifier = -10f;
}
if (main.maxParticles < min_particles)
{
ParticleOBJ_Ps[i].Stop();
ParticleOBJ_Ps[i].Clear();
if (on_lowest)
{
Particle_OBJ.SetActive(value: false);
}
num++;
}
}
if (!on_lowest && num >= ParticleOBJ_Ps.Length)
{
Particle_OBJ.SetActive(value: false);
}
}
if (ParticleOBJ_P != null)
{
ParticleSystem.MainModule main2 = ParticleOBJ_P.main;
main2.maxParticles -= rate;
if (pull_downward)
{
main2.gravityModifier = -10f;
}
if (main2.maxParticles < min_particles)
{
ParticleOBJ_P.Stop();
ParticleOBJ_P.Clear();
Particle_OBJ.SetActive(value: false);
}
}
}
private void Update()
{
if (MAIN == null)
{
if (SUN_LIGHT != null)
{
MAIN = SUN_LIGHT.GetComponent("Light") as Light;
}
else
{
Debug.Log("Please add a light to the 'SUN_LIGHT' variable");
}
}
Previous_Rot_X = Rot_Sun_X;
if (Cam_tranform == null && Camera.main != null)
{
Cam_tranform = Camera.main.transform;
}
if (Tag_based_player)
{
if (Hero == null && GameObject.FindGameObjectWithTag(Player_tag) != null)
{
Hero = GameObject.FindGameObjectWithTag(Player_tag).transform;
}
}
else if (Hero == null)
{
Hero = Camera.main.transform;
}
if ((Hero != null) & Application.isPlaying)
{
if (Butterflies_local && Butterfly_OBJ != null)
{
Butterfly_OBJ.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int i = 0; i < Butterflies2D_P.Length; i++)
{
Butterflies2D_P[i].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int j = 0; j < Butterflies2D_P.Length; j++)
{
Butterflies2D_P[j].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (Fog_local && VolumeFog_OBJ != null)
{
VolumeFog_OBJ.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int k = 0; k < VolumeFog_P.Length; k++)
{
VolumeFog_P[k].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int l = 0; l < VolumeFog_P.Length; l++)
{
VolumeFog_P[l].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (Heavy_rain_local)
{
if (Rain_Heavy != null)
{
Rain_Heavy.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int m = 0; m < Heavy_Rain_P.Length; m++)
{
Heavy_Rain_P[m].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int n = 0; n < Heavy_Rain_P.Length; n++)
{
Heavy_Rain_P[n].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (VolumeRain_Heavy != null)
{
VolumeRain_Heavy.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num = 0; num < VolumeHeavy_Rain_P.Length; num++)
{
VolumeHeavy_Rain_P[num].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num2 = 0; num2 < VolumeHeavy_Rain_P.Length; num2++)
{
VolumeHeavy_Rain_P[num2].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (RefractRain_Heavy != null)
{
RefractRain_Heavy.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num3 = 0; num3 < RefractHeavy_Rain_P.Length; num3++)
{
RefractHeavy_Rain_P[num3].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num4 = 0; num4 < RefractHeavy_Rain_P.Length; num4++)
{
RefractHeavy_Rain_P[num4].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
}
if (Mild_rain_local)
{
if (Rain_Mild != null)
{
Rain_Mild.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num5 = 0; num5 < Mild_Rain_P.Length; num5++)
{
Mild_Rain_P[num5].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num6 = 0; num6 < Mild_Rain_P.Length; num6++)
{
Mild_Rain_P[num6].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (VolumeRain_Mild != null)
{
VolumeRain_Mild.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num7 = 0; num7 < VolumeMild_Rain_P.Length; num7++)
{
VolumeMild_Rain_P[num7].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num8 = 0; num8 < VolumeMild_Rain_P.Length; num8++)
{
VolumeMild_Rain_P[num8].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (RefractRain_Mild != null)
{
RefractRain_Mild.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num9 = 0; num9 < RefractMild_Rain_P.Length; num9++)
{
RefractMild_Rain_P[num9].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num10 = 0; num10 < RefractMild_Rain_P.Length; num10++)
{
RefractMild_Rain_P[num10].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
}
if (Snow_local)
{
if (SnowStorm_OBJ != null)
{
SnowStorm_OBJ.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num11 = 0; num11 < SnowStorm_P.Length; num11++)
{
SnowStorm_P[num11].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num12 = 0; num12 < SnowStorm_P.Length; num12++)
{
SnowStorm_P[num12].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
if (Ice_Spread_OBJ != null)
{
Ice_Spread_OBJ.transform.up = Vector3.up;
if (stopRainIfUnderWater && water != null && water.gameObject.activeInHierarchy)
{
if (Hero.position.y < water.position.y)
{
for (int num13 = 0; num13 < Freezer_P.Length; num13++)
{
Freezer_P[num13].transform.GetComponent<ParticleSystemRenderer>().enabled = false;
}
}
else
{
for (int num14 = 0; num14 < Freezer_P.Length; num14++)
{
Freezer_P[num14].transform.GetComponent<ParticleSystemRenderer>().enabled = true;
}
}
}
}
}
}
if (Terrain_controller == null && Terrain.activeTerrain != null)
{
Terrain_controller = Terrain.activeTerrain.gameObject.GetComponent(typeof(SeasonalTerrainSKYMASTER)) as SeasonalTerrainSKYMASTER;
}
if (Mesh_Terrain_controller == null && Mesh_terrain != null)
{
Mesh_Terrain_controller = Mesh_terrain.gameObject.GetComponent(typeof(SeasonalTerrainSKYMASTER)) as SeasonalTerrainSKYMASTER;
}
bool flag = false;
if (!USE_ORK)
{
flag = true;
}
if (flag)
{
float num15 = 0f;
if (USE_ORK)
{
num15 = Current_Time;
if (num15 < 24f)
{
if (Auto_Cycle_Sky && Application.isPlaying && (!LimitSunUpdateRate || (LimitSunUpdateRate && Time.fixedTime - last_sun_update > Update_sun_every)))
{
Current_Time = num15 + 0.02f * SPEED * Time.deltaTime;
last_sun_update = Time.fixedTime;
}
}
else
{
if (num15 >= 24f)
{
Current_Day += 1f;
days_since_last_month_inc += 1f;
}
Current_Time = 0f;
}
if (days_since_last_month_inc > (float)days_per_month)
{
Current_Month++;
days_since_last_month_inc = 0f;
}
}
else
{
num15 = Current_Time;
if (num15 < 24f)
{
if (Auto_Cycle_Sky && Application.isPlaying && (!LimitSunUpdateRate || (LimitSunUpdateRate && Time.fixedTime - last_sun_update > Update_sun_every)))
{
Current_Time = num15 + 0.02f * SPEED * Time.deltaTime;
last_sun_update = Time.fixedTime;
}
}
else
{
if (num15 >= 24f)
{
Current_Day += 1f;
days_since_last_month_inc += 1f;
}
Current_Time = 0f;
}
if (days_since_last_month_inc > (float)days_per_month)
{
Current_Month++;
days_since_last_month_inc = 0f;
}
}
float num16 = (Current_Time - Keep_previous_time) * 0.04165041f;
if (!Application.isPlaying)
{
if (Current_Time != Keep_previous_time)
{
if (Shift_dawn != 0f)
{
SunSystem.transform.eulerAngles = new Vector3(28.1412f - (Current_Time - 20.5f) * 15f + Shift_dawn * 15f, Rot_Sun_Y, Rot_Sun_Z);
}
else
{
SunSystem.transform.eulerAngles = new Vector3(Mathf.Abs(748.1412f - (Current_Time - 20.5f) * 15f), Rot_Sun_Y, Rot_Sun_Z);
}
}
if (Keep_previous_dawn_shift != Shift_dawn)
{
if (Shift_dawn != 0f)
{
SunSystem.transform.eulerAngles = new Vector3(28.1412f - (Current_Time - 20.5f) * 15f + Shift_dawn * 15f, Rot_Sun_Y, Rot_Sun_Z);
}
else
{
SunSystem.transform.eulerAngles = new Vector3(28.1412f - (Current_Time - 20.5f) * 15f, Rot_Sun_Y, Rot_Sun_Z);
}
}
}
if (AutoSunPosition)
{
float num17 = Current_Time - Time_zone;
if (num17 >= 24f)
{
num17 -= 24f;
}
if (num17 < 0f)
{
num17 = 24f + num17;
}
float num18 = (Current_Day + 0f) % 365f;
float longitude = Longitude;
float num19 = Latitude * (MathF.PI / 180f);
float num20 = 0.98630136f * (num18 + num17 / 24f) * (MathF.PI / 180f);
float num21 = (0.396372f + 4.02543f * Mathf.Sin(num20) - 22.91327f * Mathf.Cos(num20) - 0.387205f * Mathf.Cos(2f * num20) + 0.051967f * Mathf.Sin(2f * num20) - 0.154627f * Mathf.Cos(3f * num20) + 0.084798f * Mathf.Sin(3f * num20)) * (MathF.PI / 180f);
float num22 = 0.004297f + 0.107029f * Mathf.Cos(num20) - 1.837877f * Mathf.Sin(num20) - 0.837378f * Mathf.Cos(2f * num20) - 2.340475f * Mathf.Sin(2f * num20);
float num23 = (num17 - 12f) * 15f + longitude + num22;
if (num23 > 180f)
{
num23 -= 360f;
}
if (num23 < -180f)
{
num23 += 360f;
}
float num24 = Mathf.Sin(num19) * Mathf.Sin(num21) + Mathf.Cos(num19) * Mathf.Cos(num21) * Mathf.Cos(num23 * (MathF.PI / 180f));
if (num24 > 1f)
{
num24 = 1f;
}
if (num24 < -1f)
{
num24 = -1f;
}
float num25 = Mathf.Acos(num24);
float num26 = 90f - num25 * 57.29578f;
MaxSunElevation = 90f - Latitude + num21 * 57.29578f;
float num27 = Mathf.Acos((Mathf.Sin(num21) - Mathf.Sin(num19) * Mathf.Cos(num25)) / (Mathf.Cos(num19) * Mathf.Sin(num25))) * 57.29578f;
float num28 = num27;
if (num23 > 0f)
{
num28 = 360f - num27;
}
Rot_Sun_Y = num28 - RotateNorth;
Rot_Sun_X = num26;
if (Mathf.Abs(Rot_Sun_Y) < 360f)
{
SunSystem.transform.eulerAngles = new Vector3(num26, Rot_Sun_Y, Rot_Sun_Z);
}
if (LatLonMoonPos && MoonCenterObj.transform.parent == base.transform)
{
float num29 = num18;
float f = (125.1228f - 0.05295381f * num29) * (MathF.PI / 180f);
float f2 = 5.1454f;
float num30 = (318.0634f + 0.16435732f * num29) * (MathF.PI / 180f);
float num31 = 0.0549f;
float num32 = (115.3654f + 13.064993f * num29) * (MathF.PI / 180f);
float f3 = (23.4393f - 3.563E-07f * num29) * (MathF.PI / 180f);
float f4 = num32 + num31 * Mathf.Sin(num32) * (1f + num31 * Mathf.Cos(num32));
float num33 = 60.2666f * (Mathf.Cos(f4) - num31);
float num34 = 60.2666f * (Mathf.Sqrt(1f - num31 * num31) * Mathf.Sin(f4));
float num35 = Mathf.Atan2(num34, num33) * 57.29578f;
float num36 = Mathf.Sqrt(num33 * num33 + num34 * num34);
num35 = MathF.PI / 180f * num35;
float num37 = num36 * (Mathf.Cos(f) * Mathf.Cos(num35 + num30) - Mathf.Sin(f) * Mathf.Sin(num35 + num30) * Mathf.Cos(f2));
float num38 = num36 * (Mathf.Sin(f) * Mathf.Cos(num35 + num30) + Mathf.Cos(f) * Mathf.Sin(num35 + num30) * Mathf.Cos(f2));
float num39 = num36 * (Mathf.Sin(num35 + num30) * Mathf.Sin(f2));
float num40 = num37;
float num41 = num38 * Mathf.Cos(f3) - num39 * Mathf.Sin(f3);
float y = num38 * Mathf.Sin(f3) + num39 * Mathf.Cos(f3);
float num42 = Mathf.Atan2(num41, num40);
float f5 = Mathf.Atan2(y, Mathf.Sqrt(num40 * num40 + num41 * num41));
float num43 = num23;
_ = 0f;
if (num42 > 0f)
{
num43 = num23 + 180f;
}
float num44 = Mathf.Cos(num43 * (MathF.PI / 180f)) * Mathf.Cos(f5);
float num45 = Mathf.Sin(num43 * (MathF.PI / 180f)) * Mathf.Cos(f5);
float num46 = Mathf.Sin(f5);
float num47 = num44 * Mathf.Sin(num19 + MoonPlaneRot * (MathF.PI / 180f)) - num46 * Mathf.Cos(num19 + MoonPlaneRot * (MathF.PI / 180f));
float num48 = num45;
float y2 = num44 * Mathf.Cos(num19 + MoonPlaneRot * (MathF.PI / 180f)) + num46 * Mathf.Sin(num19 + MoonPlaneRot * (MathF.PI / 180f));
float num49 = Mathf.Atan2(num48, num47) * 57.29578f - RotateNorth;
float num50 = Mathf.Atan2(y2, Mathf.Sqrt(num47 * num47 + num48 * num48)) * 57.29578f;
_ = 0f;
if (Mathf.Abs(num49) < 360f)
{
if (num17 <= 24f)
{
if (Lerp_sky_rot && num17 < 3.64f)
{
MoonCenterObj.transform.rotation = Quaternion.Lerp(MoonCenterObj.transform.rotation, Quaternion.Euler(0f - num50, num49, Rot_Sun_Z), Time.deltaTime * (0.21f + num17 * 1.6f));
}
else
{
MoonCenterObj.transform.rotation = Quaternion.Euler(0f - num50, num49, Rot_Sun_Z);
}
}
else
{
MoonCenterObj.transform.rotation = Quaternion.Lerp(MoonCenterObj.transform.rotation, Quaternion.Euler(0f - num50, num49, Rot_Sun_Z), Time.deltaTime * 3.9f);
}
}
if (StarsFollowMoon)
{
if (Star_particles_OBJ.transform.parent != MoonCenterObj)
{
Star_particles_OBJ.transform.parent = MoonCenterObj;
Star_particles_OBJ.GetComponentsInChildren<Circle_Around_ParticleSKYMASTER>(includeInactive: true)[0].enabled = false;
}
}
else if (Star_particles_OBJ.transform.parent == MoonCenterObj)
{
Star_particles_OBJ.transform.parent = base.transform;
Star_particles_OBJ.GetComponentsInChildren<Circle_Around_ParticleSKYMASTER>(includeInactive: true)[0].enabled = true;
}
}
}
if (!AutoSunPosition && ((Previous_Rot_Y != Rot_Sun_Y) | (Previous_Rot_Z != Rot_Sun_Z)))
{
if (Shift_dawn != 0f)
{
SunSystem.transform.eulerAngles = new Vector3(28.1412f - (Current_Time - 20.5f) * 15f + Shift_dawn * 15f, Rot_Sun_Y, Rot_Sun_Z);
}
else
{
SunSystem.transform.eulerAngles = new Vector3(Mathf.Abs(748.1412f - (Current_Time - 20.5f) * 15f), Rot_Sun_Y, Rot_Sun_Z);
}
}
if (num16 != 0f && !AutoSunPosition)
{
SunSystem.transform.Rotate(Vector3.right * num16 * 360f);
}
if (Application.isPlaying)
{
if (Seasonal_prev != Seasonal)
{
Seasonal_prev = Seasonal;
if (Day_hours < 12f)
{
SunSystem.transform.Rotate(new Vector3(0f, Seasonal, 0f));
}
else
{
SunSystem.transform.Rotate(new Vector3(0f, 0f - Seasonal, 0f));
}
}
if (Horizontal_factor_prev != Horizontal_factor)
{
Horizontal_factor_prev = Horizontal_factor;
float horizontal_factor = Horizontal_factor;
SunSystem.transform.eulerAngles = new Vector3(SunSystem.transform.eulerAngles.x, SunSystem.transform.eulerAngles.y + horizontal_factor, SunSystem.transform.eulerAngles.z);
}
}
Keep_previous_time = Current_Time;
Keep_previous_dawn_shift = Shift_dawn;
Previous_Rot_Y = Rot_Sun_Y;
Previous_Rot_Z = Rot_Sun_Z;
if (Keep_prev_sun_pos != SUN_LIGHT.transform.position)
{
SUN_LIGHT.transform.LookAt(SunTarget.transform);
Keep_prev_sun_pos = SUN_LIGHT.transform.position;
}
if (((((Weather != previous_weather) ? 1u : 0u) | 1u) & (On_demand ? 1u : 0u)) != 0)
{
if (Weather != previous_weather)
{
previous_weather = Weather;
if (!RenderSettings.fog)
{
RenderSettings.fogDensity = 0f;
}
}
if ((Weather == Weather_types.Foggy) | (Weather == Weather_types.HeavyFog))
{
FogMode mode = FogMode.Exponential;
float num51 = 0.007f + UnityEngine.Random.Range(-0.001f, 0.001f);
float num52 = 1f;
Color color = new Color(0.9f, 0.9f, 0.9f, 1f);
if ((Current_Time < 18f) & (Current_Time > 9f))
{
color = ((Current_Time > 16f) ? new Color(0.8f, 0.45f, 0.55f, 1f) : ((!(Current_Time > 12f)) ? new Color(0.5f, 0.15f, 0.45f, 1f) : new Color(0.9f, 0.9f, 0.9f, 1f)));
if ((Season == 1) | (Season == 0))
{
color = Spring_fog_day;
num51 = Spring_fog_day_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 2)
{
color = Summer_fog_day;
num51 = Summer_fog_day_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 3)
{
color = Autumn_fog_day;
num51 = Autumn_fog_day_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 4)
{
color = Winter_fog_day;
num51 = Winter_fog_day_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
}
else if ((Current_Time <= 9f) & (Current_Time >= 0f))
{
color = new Color(0.2f, 0.2f, 0.2f, 1f);
num52 = 1f;
if ((Season == 1) | (Season == 0))
{
color = Spring_fog_night;
num51 = Spring_fog_night_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 2)
{
color = Summer_fog_night;
num51 = Summer_fog_night_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 3)
{
color = Autumn_fog_night;
num51 = Autumn_fog_night_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 4)
{
color = Winter_fog_night;
num51 = Winter_fog_night_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
}
else
{
if (Current_Time > 22.5f)
{
color = new Color(0.2f, 0.2f, 0.2f, 1f);
num52 = 1f;
}
else
{
color = new Color(0.9f, 0.6f, 0.3f, 1f);
}
if ((Season == 1) | (Season == 0))
{
color = Spring_fog_dusk;
num51 = Spring_fog_dusk_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 2)
{
color = Summer_fog_dusk;
num51 = Summer_fog_dusk_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 3)
{
color = Autumn_fog_dusk;
num51 = Autumn_fog_dusk_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
else if (Season == 4)
{
color = Winter_fog_dusk;
num51 = Winter_fog_dusk_density * Fog_Density_Mult;
mode = FogMode.ExponentialSquared;
}
}
float density = num51;
float fog_Density_Speed = Fog_Density_Speed;
if (Weather == Weather_types.HeavyFog)
{
mode = FogMode.Exponential;
}
Make_Fog_Appear(color / num52, density, mode, fog_Density_Speed, 0);
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
int num53 = 0;
for (int num54 = 0; num54 < Volcano_OBJ.Length; num54++)
{
int num55 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array = new ParticleSystem[num55];
for (int num56 = 0; num56 < num55; num56++)
{
array[num56] = Volcanos_P[num53];
num53++;
}
Make_Dissappear(Volcano_OBJ[num54], array, null, 5, 10, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.HeavyFog)
{
Make_Appear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 200, reset_pcount: true, 5);
Make_Appear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 200, reset_pcount: true, 5);
Make_Appear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 200, reset_pcount: true, 5);
Make_Appear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 200, reset_pcount: true, 5);
}
else
{
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num57 = 0; num57 < Tornado_OBJs.Length; num57++)
{
Make_Dissappear(Tornado_OBJs[num57], null, Tornados_P[num57], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if ((Weather == Weather_types.HeavyStorm) | (Weather == Weather_types.HeavyStormDark))
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num58 = 0;
for (int num59 = 0; num59 < Volcano_OBJ.Length; num59++)
{
int num60 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array2 = new ParticleSystem[num60];
for (int num61 = 0; num61 < num60; num61++)
{
array2[num61] = Volcanos_P[num58];
num58++;
}
Make_Dissappear(Volcano_OBJ[num59], array2, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
if (Weather == Weather_types.HeavyStormDark)
{
Make_Appear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, Flat_cloud_max_part, reset_pcount: true, 10);
Make_Appear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, Flat_cloud_max_part, reset_pcount: true, 10);
}
else
{
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Appear(Surround_Clouds, Surround_Clouds_P, null, Storm_cloud_max_part, reset_pcount: false, 10);
Make_Appear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, Storm_cloud_max_part, reset_pcount: false, 10);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num62 = 0; num62 < Tornado_OBJs.Length; num62++)
{
Make_Dissappear(Tornado_OBJs[num62], null, Tornados_P[num62], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Appear(Rain_Heavy, Heavy_Rain_P, null, 300, reset_pcount: false, 10);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if ((Weather == Weather_types.SnowStorm) | (Weather == Weather_types.FreezeStorm))
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num63 = 0;
for (int num64 = 0; num64 < Volcano_OBJ.Length; num64++)
{
int num65 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array3 = new ParticleSystem[num65];
for (int num66 = 0; num66 < num65; num66++)
{
array3[num66] = Volcanos_P[num63];
num63++;
}
Make_Dissappear(Volcano_OBJ[num64], array3, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Appear(SnowStorm_OBJ, SnowStorm_P, null, Snow_cloud_max_part, reset_pcount: true, 10);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
if (Weather == Weather_types.SnowStorm)
{
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, null, null, 5, 50, pull_downward: false, on_lowest: false);
}
else
{
Make_Appear(Ice_Spread_OBJ, Freezer_P, null, 250, reset_pcount: true, 10);
Make_Appear(Ice_System_OBJ, null, null, 250, reset_pcount: true, 10);
}
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num67 = 0; num67 < Tornado_OBJs.Length; num67++)
{
Make_Dissappear(Tornado_OBJs[num67], null, Tornados_P[num67], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.LightningStorm)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num68 = 0;
for (int num69 = 0; num69 < Volcano_OBJ.Length; num69++)
{
int num70 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array4 = new ParticleSystem[num70];
for (int num71 = 0; num71 < num70; num71++)
{
array4[num71] = Volcanos_P[num68];
num68++;
}
Make_Dissappear(Volcano_OBJ[num69], array4, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num72 = 0; num72 < Tornado_OBJs.Length; num72++)
{
Make_Dissappear(Tornado_OBJs[num72], null, Tornados_P[num72], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Appear(Lightning_System_OBJ, Lightning_System_P, null, Lightning_cloud_max_part, reset_pcount: false, 15);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.FlatClouds)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num73 = 0;
for (int num74 = 0; num74 < Volcano_OBJ.Length; num74++)
{
int num75 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array5 = new ParticleSystem[num75];
for (int num76 = 0; num76 < num75; num76++)
{
array5[num76] = Volcanos_P[num73];
num73++;
}
Make_Dissappear(Volcano_OBJ[num74], array5, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Appear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, Flat_cloud_max_part, reset_pcount: true, 5);
Make_Appear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, Flat_cloud_max_part, reset_pcount: true, 5);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num77 = 0; num77 < Tornado_OBJs.Length; num77++)
{
Make_Dissappear(Tornado_OBJs[num77], null, Tornados_P[num77], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Appear(Rain_Heavy, Heavy_Rain_P, null, 1000, reset_pcount: true, 25);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.Cloudy)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num78 = 0;
for (int num79 = 0; num79 < Volcano_OBJ.Length; num79++)
{
int num80 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array6 = new ParticleSystem[num80];
for (int num81 = 0; num81 < num80; num81++)
{
array6[num81] = Volcanos_P[num78];
num78++;
}
Make_Dissappear(Volcano_OBJ[num79], array6, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
if (Season != 3)
{
Make_Appear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 300, reset_pcount: true, 15);
Make_Appear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 300, reset_pcount: true, 15);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
else
{
Make_Appear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, Real_cloud_max_part, reset_pcount: true, 15);
Make_Appear(Upper_Cloud_Real, Real_Clouds_Up_P, null, Real_cloud_max_part, reset_pcount: true, 15);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
Make_Appear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 300, reset_pcount: true, 15);
Make_Appear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 300, reset_pcount: true, 15);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num82 = 0; num82 < Tornado_OBJs.Length; num82++)
{
Make_Dissappear(Tornado_OBJs[num82], null, Tornados_P[num82], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.VolcanoErupt)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num83 = 0;
for (int num84 = 0; num84 < Volcano_OBJ.Length; num84++)
{
int num85 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array7 = new ParticleSystem[num85];
for (int num86 = 0; num86 < num85; num86++)
{
array7[num86] = Volcanos_P[num83];
num83++;
}
Make_Appear(Volcano_OBJ[num84], array7, null, 1300, reset_pcount: true, 5);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num87 = 0; num87 < Tornado_OBJs.Length; num87++)
{
Make_Dissappear(Tornado_OBJs[num87], null, Tornados_P[num87], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.RollingFog)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num88 = 0;
for (int num89 = 0; num89 < Volcano_OBJ.Length; num89++)
{
int num90 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array8 = new ParticleSystem[num90];
for (int num91 = 0; num91 < num90; num91++)
{
array8[num91] = Volcanos_P[num88];
num88++;
}
Make_Dissappear(Volcano_OBJ[num89], array8, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Appear(VolumeFog_OBJ, VolumeFog_P, null, Volume_fog_max_part, reset_pcount: true, 5);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num92 = 0; num92 < Tornado_OBJs.Length; num92++)
{
Make_Dissappear(Tornado_OBJs[num92], null, Tornados_P[num92], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.Tornado)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num93 = 0;
for (int num94 = 0; num94 < Volcano_OBJ.Length; num94++)
{
int num95 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array9 = new ParticleSystem[num95];
for (int num96 = 0; num96 < num95; num96++)
{
array9[num96] = Volcanos_P[num93];
num93++;
}
Make_Dissappear(Volcano_OBJ[num94], array9, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num97 = 0; num97 < 1; num97++)
{
Make_Appear(Tornado_OBJs[num97], null, Tornados_P[num97], 250, reset_pcount: true, 10);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.Rain)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num98 = 0;
for (int num99 = 0; num99 < Volcano_OBJ.Length; num99++)
{
int num100 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array10 = new ParticleSystem[num100];
for (int num101 = 0; num101 < num100; num101++)
{
array10[num101] = Volcanos_P[num98];
num98++;
}
Make_Dissappear(Volcano_OBJ[num99], array10, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Appear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 700, reset_pcount: true, 5);
Make_Appear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 700, reset_pcount: true, 5);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num102 = 0; num102 < Tornado_OBJs.Length; num102++)
{
Make_Dissappear(Tornado_OBJs[num102], null, Tornados_P[num102], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Appear(Rain_Mild, Mild_Rain_P, null, 1000, reset_pcount: true, 25);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
if (Weather == Weather_types.Sunny)
{
if (!Use_fog)
{
Make_Fog_Dissappear(1.1f);
}
int num103 = 0;
for (int num104 = 0; num104 < Volcano_OBJ.Length; num104++)
{
int num105 = Volcanos_P.Length / Volcano_OBJ.Length;
ParticleSystem[] array11 = new ParticleSystem[num105];
for (int num106 = 0; num106 < num105; num106++)
{
array11[num106] = Volcanos_P[num103];
num103++;
}
Make_Dissappear(Volcano_OBJ[num104], array11, null, 5, 10, pull_downward: false, on_lowest: false);
}
Make_Dissappear(SnowStorm_OBJ, SnowStorm_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(VolumeFog_OBJ, VolumeFog_P, null, 1, 5, pull_downward: true, on_lowest: false);
Make_Dissappear(Lower_Dynamic_Cloud, Dynamic_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Dynamic_Cloud, Dynamic_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Static_Cloud, Cloud_Static_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Static_Cloud, Cloud_Static_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Bed, Cloud_bed_Dn_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Bed, Cloud_bed_Up_P, null, 5, 8, pull_downward: false, on_lowest: false);
Make_Dissappear(Lower_Cloud_Real, Real_Clouds_Dn_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Upper_Cloud_Real, Real_Clouds_Up_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds, Surround_Clouds_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Surround_Clouds_Heavy, Surround_Clouds_Heavy_P, null, 1, 2, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_Spread_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Ice_System_OBJ, Freezer_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly_OBJ, Butterflies2D_P, null, 5, 50, pull_downward: false, on_lowest: false);
for (int num107 = 0; num107 < Tornado_OBJs.Length; num107++)
{
Make_Dissappear(Tornado_OBJs[num107], null, Tornados_P[num107], 5, 50, pull_downward: false, on_lowest: false);
}
Make_Dissappear(Lightning_System_OBJ, Lightning_System_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Butterfly3D_OBJ[0], Butterflies3D_P, null, 2, 1, pull_downward: true, on_lowest: true);
Make_Dissappear(Rain_Heavy, Heavy_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Rain_Mild, Mild_Rain_P, null, 5, 50, pull_downward: false, on_lowest: false);
Make_Dissappear(Sun_Ray_Cloud, Sun_Ray_Cloud_P, null, 5, 50, pull_downward: false, on_lowest: false);
}
}
if (Seasonal_change_auto & Application.isPlaying)
{
float num108 = 255f;
int num109 = Current_Month / 12;
float num110 = (float)(Current_Month - num109 * 12) / 3f;
if (num110 >= 3f)
{
Season = 4;
if (num110 > 3.1f && num110 < 3.65f)
{
if (SnowStorm_OBJ != null)
{
if (!SnowStorm_OBJ.activeInHierarchy)
{
SnowStorm_OBJ.SetActive(value: true);
Ice_Spread_OBJ.SetActive(value: true);
Ice_System_OBJ.SetActive(value: true);
if (SnowStorm_P != null)
{
for (int num111 = 0; num111 < SnowStorm_P.Length; num111++)
{
SnowStorm_P[num111].Stop();
SnowStorm_P[num111].Clear();
}
}
}
else if (SnowStorm_P != null)
{
for (int num112 = 0; num112 < SnowStorm_P.Length; num112++)
{
ParticleSystem.MainModule main = SnowStorm_P[num112].main;
main.maxParticles = Snow_cloud_max_part;
SnowStorm_P[num112].Play();
}
}
}
}
else if (num110 >= 3.65f && SnowStorm_OBJ != null && SnowStorm_OBJ.activeInHierarchy && SnowStorm_P != null)
{
for (int num113 = 0; num113 < SnowStorm_P.Length; num113++)
{
ParticleSystem.MainModule main2 = SnowStorm_P[num113].main;
main2.maxParticles -= 80;
if (main2.maxParticles < 5)
{
SnowStorm_P[num113].Stop();
SnowStorm_P[num113].Clear();
SnowStorm_OBJ.SetActive(value: false);
Ice_Spread_OBJ.SetActive(value: false);
Ice_System_OBJ.SetActive(value: false);
}
}
}
for (int num114 = 0; num114 < FallingLeaves_OBJ.Length; num114++)
{
if (!FallingLeaves_OBJ[num114].activeInHierarchy || FallingLeaves_P == null)
{
continue;
}
for (int num115 = 0; num115 < FallingLeaves_P.Length; num115++)
{
ParticleSystem.MainModule main3 = FallingLeaves_P[num115].main;
main3.maxParticles -= 10;
if (main3.maxParticles < 5)
{
FallingLeaves_P[num115].Stop();
FallingLeaves_P[num115].Clear();
FallingLeaves_OBJ[num114].SetActive(value: false);
}
}
}
for (int num116 = 0; num116 < Tornado_OBJs.Length; num116++)
{
Make_Dissappear(Tornado_OBJs[num116], null, Tornados_P[num116], 5, 11, pull_downward: false, on_lowest: false);
}
if (num110 >= 3.4f && num110 < 3.9f)
{
if (Surround_Clouds_Heavy != null)
{
if (!Surround_Clouds_Heavy.activeInHierarchy)
{
Surround_Clouds_Heavy.SetActive(value: true);
if (Surround_Clouds_Heavy_P != null)
{
for (int num117 = 0; num117 < Surround_Clouds_Heavy_P.Length; num117++)
{
Surround_Clouds_Heavy_P[num117].Stop();
Surround_Clouds_Heavy_P[num117].Clear();
}
}
}
else if (Surround_Clouds_Heavy_P != null)
{
for (int num118 = 0; num118 < Surround_Clouds_Heavy_P.Length; num118++)
{
ParticleSystem.MainModule main4 = Surround_Clouds_Heavy_P[num118].main;
main4.maxParticles = Storm_cloud_max_part;
Surround_Clouds_Heavy_P[num118].Play();
}
}
}
if (Rain_Heavy != null)
{
if (!Rain_Heavy.activeInHierarchy)
{
Rain_Heavy.SetActive(value: true);
if (Heavy_Rain_P != null)
{
for (int num119 = 0; num119 < Heavy_Rain_P.Length; num119++)
{
Heavy_Rain_P[num119].Stop();
Heavy_Rain_P[num119].Clear();
}
}
}
else if (Heavy_Rain_P != null)
{
for (int num120 = 0; num120 < Heavy_Rain_P.Length; num120++)
{
ParticleSystem.MainModule main5 = Heavy_Rain_P[num120].main;
main5.maxParticles = 300;
Heavy_Rain_P[num120].Play();
}
}
}
if (Lightning_OBJ != null)
{
Lightning_OBJ.SetActive(value: true);
}
if (Lower_Cloud_Bed != null && Lower_Cloud_Bed.activeInHierarchy && Cloud_bed_Dn_P != null)
{
for (int num121 = 0; num121 < Cloud_bed_Dn_P.Length; num121++)
{
ParticleSystem.MainModule main6 = Cloud_bed_Dn_P[num121].main;
main6.maxParticles -= 110;
if (main6.maxParticles < 5)
{
Cloud_bed_Dn_P[num121].Stop();
Cloud_bed_Dn_P[num121].Clear();
Lower_Cloud_Bed.SetActive(value: false);
}
}
}
}
else if (Lower_Cloud_Bed != null)
{
if (!Lower_Cloud_Bed.activeInHierarchy)
{
Lower_Cloud_Bed.SetActive(value: true);
if (Cloud_bed_Dn_P != null)
{
for (int num122 = 0; num122 < Cloud_bed_Dn_P.Length; num122++)
{
Cloud_bed_Dn_P[num122].Stop();
Cloud_bed_Dn_P[num122].Clear();
}
}
}
else if (Cloud_bed_Dn_P != null)
{
for (int num123 = 0; num123 < Cloud_bed_Dn_P.Length; num123++)
{
ParticleSystem.MainModule main7 = Cloud_bed_Dn_P[num123].main;
main7.maxParticles = Flat_cloud_max_part;
Cloud_bed_Dn_P[num123].Play();
}
}
}
if (Upper_Cloud_Bed != null)
{
if (!Upper_Cloud_Bed.activeInHierarchy)
{
Upper_Cloud_Bed.SetActive(value: true);
if (Cloud_bed_Up_P != null)
{
for (int num124 = 0; num124 < Cloud_bed_Up_P.Length; num124++)
{
Cloud_bed_Up_P[num124].Stop();
Cloud_bed_Up_P[num124].Clear();
}
}
}
else if (Cloud_bed_Up_P != null)
{
for (int num125 = 0; num125 < Cloud_bed_Up_P.Length; num125++)
{
ParticleSystem.MainModule main8 = Cloud_bed_Up_P[num125].main;
main8.maxParticles = Flat_cloud_max_part;
Cloud_bed_Up_P[num125].Play();
}
}
}
if (Lower_Cloud_Real != null && Lower_Cloud_Real.activeInHierarchy && Real_Clouds_Dn_P != null)
{
for (int num126 = 0; num126 < Real_Clouds_Dn_P.Length; num126++)
{
ParticleSystem.MainModule main9 = Real_Clouds_Dn_P[num126].main;
main9.maxParticles -= 10;
if (main9.maxParticles < 5)
{
Real_Clouds_Dn_P[num126].Stop();
Real_Clouds_Dn_P[num126].Clear();
Lower_Cloud_Real.SetActive(value: false);
}
}
}
if (Upper_Cloud_Real != null && Upper_Cloud_Real.activeInHierarchy && Real_Clouds_Up_P != null)
{
for (int num127 = 0; num127 < Real_Clouds_Up_P.Length; num127++)
{
ParticleSystem.MainModule main10 = Real_Clouds_Up_P[num127].main;
main10.maxParticles -= 10;
if (main10.maxParticles < 5)
{
Real_Clouds_Up_P[num127].Stop();
Real_Clouds_Up_P[num127].Clear();
Upper_Cloud_Real.SetActive(value: false);
}
}
}
bool flag2 = true;
if (num110 >= 3.8f)
{
flag2 = false;
Lightning_System_OBJ.SetActive(value: true);
}
if (flag2)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color color2 = new Color(60f / num108, 70f / num108, 75f / num108, 255f / num108);
float num128 = 0.01f;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
color2 = Winter_fog_day;
num128 = Winter_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
color2 = Winter_fog_night;
num128 = Winter_fog_night_density * Fog_Density_Mult;
}
else
{
color2 = Winter_fog_dusk;
num128 = Winter_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode2 = fogMode;
float density2 = num128;
float speed = Fog_Density_Speed;
if (Weather == Weather_types.HeavyFog)
{
density2 = num128 / 2f;
speed = 0.015f;
}
Make_Fog_Appear(color2, density2, mode2, speed, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (num110 >= 2f)
{
Season = 3;
if (num110 >= 2f)
{
for (int num129 = 0; num129 < FallingLeaves_OBJ.Length; num129++)
{
if (!FallingLeaves_OBJ[num129].activeInHierarchy)
{
FallingLeaves_OBJ[num129].SetActive(value: true);
if (FallingLeaves_P != null)
{
for (int num130 = 0; num130 < FallingLeaves_P.Length; num130++)
{
FallingLeaves_P[num130].Stop();
FallingLeaves_P[num130].Clear();
}
}
}
else if (FallingLeaves_P != null)
{
for (int num131 = 0; num131 < FallingLeaves_P.Length; num131++)
{
ParticleSystem.MainModule main11 = FallingLeaves_P[num131].main;
main11.maxParticles = 300;
FallingLeaves_P[num131].Play();
}
}
}
}
if (num110 >= 2.5f)
{
for (int num132 = 0; num132 < Tornado_OBJs.Length; num132++)
{
Make_Appear(Tornado_OBJs[num132], null, Tornados_P[num132], 200, reset_pcount: false, 25);
}
}
if (Lower_Cloud_Real != null)
{
if (!Lower_Cloud_Real.activeInHierarchy)
{
Lower_Cloud_Real.SetActive(value: true);
if (Real_Clouds_Dn_P != null)
{
for (int num133 = 0; num133 < Real_Clouds_Dn_P.Length; num133++)
{
Real_Clouds_Dn_P[num133].Stop();
Real_Clouds_Dn_P[num133].Clear();
}
}
}
else if (Real_Clouds_Dn_P != null)
{
for (int num134 = 0; num134 < Real_Clouds_Dn_P.Length; num134++)
{
ParticleSystem.MainModule main12 = Real_Clouds_Dn_P[num134].main;
main12.maxParticles = Real_cloud_max_part;
Real_Clouds_Dn_P[num134].Play();
}
}
}
if (Upper_Cloud_Real != null)
{
if (!Upper_Cloud_Real.activeInHierarchy)
{
Upper_Cloud_Real.SetActive(value: true);
if (Real_Clouds_Up_P != null)
{
for (int num135 = 0; num135 < Real_Clouds_Up_P.Length; num135++)
{
Real_Clouds_Up_P[num135].Stop();
Real_Clouds_Up_P[num135].Clear();
}
}
}
else if (Real_Clouds_Up_P != null)
{
for (int num136 = 0; num136 < Real_Clouds_Up_P.Length; num136++)
{
ParticleSystem.MainModule main13 = Real_Clouds_Up_P[num136].main;
main13.maxParticles = Real_cloud_max_part;
Real_Clouds_Up_P[num136].Play();
}
}
}
if (num110 >= 2.5f && Surround_Clouds != null)
{
if (!Surround_Clouds.activeInHierarchy)
{
Surround_Clouds.SetActive(value: true);
if (Surround_Clouds_P != null)
{
for (int num137 = 0; num137 < Surround_Clouds_P.Length; num137++)
{
Surround_Clouds_P[num137].Stop();
Surround_Clouds_P[num137].Clear();
}
}
}
else if (Surround_Clouds_P != null)
{
for (int num138 = 0; num138 < Surround_Clouds_P.Length; num138++)
{
ParticleSystem.MainModule main14 = Surround_Clouds_P[num138].main;
main14.maxParticles = 300;
Surround_Clouds_P[num138].Play();
}
}
}
if (Lower_Dynamic_Cloud != null && Lower_Dynamic_Cloud.activeInHierarchy && Dynamic_Clouds_Dn_P != null)
{
for (int num139 = 0; num139 < Dynamic_Clouds_Dn_P.Length; num139++)
{
ParticleSystem.MainModule main15 = Dynamic_Clouds_Dn_P[num139].main;
main15.maxParticles -= 10;
if (main15.maxParticles < 5)
{
Dynamic_Clouds_Dn_P[num139].Stop();
Dynamic_Clouds_Dn_P[num139].Clear();
Lower_Dynamic_Cloud.SetActive(value: false);
}
}
}
if (Upper_Dynamic_Cloud != null && Upper_Dynamic_Cloud.activeInHierarchy && Dynamic_Clouds_Up_P != null)
{
for (int num140 = 0; num140 < Dynamic_Clouds_Up_P.Length; num140++)
{
ParticleSystem.MainModule main16 = Dynamic_Clouds_Up_P[num140].main;
main16.maxParticles -= 10;
if (main16.maxParticles < 5)
{
Dynamic_Clouds_Up_P[num140].Stop();
Dynamic_Clouds_Up_P[num140].Clear();
Upper_Dynamic_Cloud.SetActive(value: false);
}
}
}
if (Sun_Ray_Cloud != null)
{
Sun_Ray_Cloud.SetActive(value: false);
}
bool flag3 = true;
if (num110 >= 2.4f)
{
flag3 = true;
}
if (flag3)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color color3 = new Color(100f / num108, 80f / num108, 100f / num108, 255f / num108);
float num141 = 0.01f;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
color3 = Autumn_fog_day;
num141 = Autumn_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
color3 = Autumn_fog_night;
num141 = Autumn_fog_night_density * Fog_Density_Mult;
}
else
{
color3 = Autumn_fog_dusk;
num141 = Autumn_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode3 = fogMode;
float density3 = num141;
float speed2 = Fog_Density_Speed;
if (Weather == Weather_types.HeavyFog)
{
density3 = num141 / 2f;
speed2 = 0.015f;
}
Make_Fog_Appear(color3, density3, mode3, speed2, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (num110 >= 1f)
{
Season = 2;
if (Lower_Cloud_Bed != null && Lower_Cloud_Bed.activeInHierarchy && Cloud_bed_Dn_P != null)
{
for (int num142 = 0; num142 < Cloud_bed_Dn_P.Length; num142++)
{
ParticleSystem.MainModule main17 = Cloud_bed_Dn_P[num142].main;
main17.maxParticles -= 10;
if (main17.maxParticles < 5)
{
Cloud_bed_Dn_P[num142].Stop();
Cloud_bed_Dn_P[num142].Clear();
Lower_Cloud_Bed.SetActive(value: false);
}
}
}
if (Upper_Cloud_Bed != null && Upper_Cloud_Bed.activeInHierarchy && Cloud_bed_Up_P != null)
{
for (int num143 = 0; num143 < Cloud_bed_Up_P.Length; num143++)
{
ParticleSystem.MainModule main18 = Cloud_bed_Up_P[num143].main;
main18.maxParticles -= 10;
if (main18.maxParticles < 5)
{
Cloud_bed_Up_P[num143].Stop();
Cloud_bed_Up_P[num143].Clear();
Upper_Cloud_Bed.SetActive(value: false);
}
}
}
if (Butterfly_OBJ != null && Butterfly_OBJ.activeInHierarchy && Butterflies2D_P != null)
{
for (int num144 = 0; num144 < Butterflies2D_P.Length; num144++)
{
ParticleSystem.MainModule main19 = Butterflies2D_P[num144].main;
main19.maxParticles -= 40;
if (main19.maxParticles < 5)
{
Butterflies2D_P[num144].Stop();
Butterflies2D_P[num144].Clear();
Butterfly_OBJ.SetActive(value: false);
}
}
}
}
else if (num110 >= 0f)
{
Season = 1;
if (Butterfly_OBJ != null)
{
if (!Butterfly_OBJ.activeInHierarchy)
{
Butterfly_OBJ.SetActive(value: true);
if (Butterflies2D_P != null)
{
for (int num145 = 0; num145 < Butterflies2D_P.Length; num145++)
{
ParticleSystem.MainModule main20 = Butterflies2D_P[num145].main;
main20.startColor = new Color(main20.startColor.color.r, main20.startColor.color.g, main20.startColor.color.b, 0f);
}
}
}
else if (Butterflies2D_P != null)
{
for (int num146 = 0; num146 < Butterflies2D_P.Length; num146++)
{
ParticleSystem.MainModule main21 = Butterflies2D_P[num146].main;
Color color4 = main21.startColor.color;
main21.startColor = Color.Lerp(color4, new Color(color4.r, color4.g, color4.b, 1f), 0.5f * Time.deltaTime);
}
}
}
if (Lower_Dynamic_Cloud != null)
{
if (!Lower_Dynamic_Cloud.activeInHierarchy)
{
Lower_Dynamic_Cloud.SetActive(value: true);
if (Dynamic_Clouds_Dn_P != null)
{
for (int num147 = 0; num147 < Dynamic_Clouds_Dn_P.Length; num147++)
{
Dynamic_Clouds_Dn_P[num147].Stop();
Dynamic_Clouds_Dn_P[num147].Clear();
}
}
}
else if (Dynamic_Clouds_Dn_P != null)
{
for (int num148 = 0; num148 < Dynamic_Clouds_Dn_P.Length; num148++)
{
Dynamic_Clouds_Dn_P[num148].Play();
}
}
}
if (Upper_Dynamic_Cloud != null)
{
if (!Upper_Dynamic_Cloud.activeInHierarchy)
{
Upper_Dynamic_Cloud.SetActive(value: true);
if (Dynamic_Clouds_Up_P != null)
{
for (int num149 = 0; num149 < Dynamic_Clouds_Up_P.Length; num149++)
{
Dynamic_Clouds_Up_P[num149].Stop();
Dynamic_Clouds_Up_P[num149].Clear();
}
}
}
else if (Dynamic_Clouds_Up_P != null)
{
for (int num150 = 0; num150 < Dynamic_Clouds_Up_P.Length; num150++)
{
Dynamic_Clouds_Up_P[num150].Play();
}
}
}
if (num110 > 0.6f && Surround_Clouds != null && Surround_Clouds.activeInHierarchy && Surround_Clouds_P != null)
{
for (int num151 = 0; num151 < Surround_Clouds_P.Length; num151++)
{
ParticleSystem.MainModule main22 = Surround_Clouds_P[num151].main;
main22.maxParticles -= 20;
if (main22.maxParticles < 5)
{
Surround_Clouds_P[num151].Stop();
Surround_Clouds_P[num151].Clear();
Surround_Clouds.SetActive(value: false);
}
}
}
if (num110 >= 0.4f)
{
if (Surround_Clouds_Heavy != null && Surround_Clouds_Heavy.activeInHierarchy && Surround_Clouds_Heavy_P != null)
{
for (int num152 = 0; num152 < Surround_Clouds_Heavy_P.Length; num152++)
{
ParticleSystem.MainModule main23 = Surround_Clouds_Heavy_P[num152].main;
main23.maxParticles -= 10;
if (main23.maxParticles < 5)
{
Surround_Clouds_Heavy_P[num152].Stop();
Surround_Clouds_Heavy_P[num152].Clear();
Surround_Clouds_Heavy.SetActive(value: false);
}
}
}
if (Rain_Heavy != null && Rain_Heavy.activeInHierarchy && Heavy_Rain_P != null)
{
for (int num153 = 0; num153 < Heavy_Rain_P.Length; num153++)
{
ParticleSystem.MainModule main24 = Heavy_Rain_P[num153].main;
main24.maxParticles -= 10;
if (main24.maxParticles < 5)
{
Heavy_Rain_P[num153].Stop();
Heavy_Rain_P[num153].Clear();
Rain_Heavy.SetActive(value: false);
}
}
}
}
if (Sun_Ray_Cloud != null)
{
Sun_Ray_Cloud.SetActive(value: true);
}
if (false)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color spring_fog_day = Spring_fog_day;
float num154 = Spring_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
spring_fog_day = Spring_fog_day;
num154 = Spring_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
spring_fog_day = Spring_fog_night;
num154 = Spring_fog_night_density * Fog_Density_Mult;
}
else
{
spring_fog_day = Spring_fog_dusk;
num154 = Spring_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode4 = fogMode;
float fog_Density_Speed2 = Fog_Density_Speed;
Make_Fog_Appear(spring_fog_day, num154, mode4, fog_Density_Speed2, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
}
if (ScreenRainDrops && RainDropsPlane != null && ScreenRainDropsMat != null)
{
if ((currentWeatherName == Volume_Weather_types.HeavyStorm) | (currentWeatherName == Volume_Weather_types.HeavyStormDark) | (currentWeatherName == Volume_Weather_types.Rain) | (water != null && water.GetComponent<WaterHandlerSM>() != null && water.GetComponent<WaterHandlerSM>().BelowWater))
{
if (ScreenFreezeFX)
{
float a = ScreenRainDropsMat.GetFloat("_Speed");
ScreenRainDropsMat.SetFloat("_Speed", Mathf.Lerp(a, 0f, Time.deltaTime * FreezeSpeed));
float a2 = ScreenRainDropsMat.GetFloat("_WaterAmount");
ScreenRainDropsMat.SetFloat("_WaterAmount", Mathf.Lerp(a2, MaxWater, Time.deltaTime * FreezeSpeed));
float a3 = ScreenRainDropsMat.GetFloat("_BumpAmt");
ScreenRainDropsMat.SetFloat("_BumpAmt", Mathf.Lerp(a3, MaxRefract * 4f, Time.deltaTime * FreezeSpeed));
if (FreezeInwards)
{
float a4 = ScreenRainDropsMat.GetFloat("_FreezeFacrorA");
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", Mathf.Lerp(a4, 0f, Time.deltaTime * FreezeSpeed));
float a5 = ScreenRainDropsMat.GetFloat("_FreezeFacrorB");
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", Mathf.Lerp(a5, 0f, Time.deltaTime * FreezeSpeed));
float a6 = ScreenRainDropsMat.GetFloat("_FreezeFacrorC");
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", Mathf.Lerp(a6, 1f, Time.deltaTime * FreezeSpeed));
}
else
{
float a7 = ScreenRainDropsMat.GetFloat("_FreezeFacrorA");
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", Mathf.Lerp(a7, 1f, Time.deltaTime * FreezeSpeed));
float a8 = ScreenRainDropsMat.GetFloat("_FreezeFacrorB");
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", Mathf.Lerp(a8, 1f, Time.deltaTime * FreezeSpeed));
float a9 = ScreenRainDropsMat.GetFloat("_FreezeFacrorC");
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", Mathf.Lerp(a9, 0f, Time.deltaTime * FreezeSpeed));
}
}
else
{
float a10 = ScreenRainDropsMat.GetFloat("_Speed");
ScreenRainDropsMat.SetFloat("_Speed", Mathf.Lerp(a10, MaxDropSpeed, Time.deltaTime * FreezeSpeed));
float a11 = ScreenRainDropsMat.GetFloat("_WaterAmount");
ScreenRainDropsMat.SetFloat("_WaterAmount", Mathf.Lerp(a11, MaxWater, Time.deltaTime * FreezeSpeed));
float a12 = ScreenRainDropsMat.GetFloat("_BumpAmt");
ScreenRainDropsMat.SetFloat("_BumpAmt", Mathf.Lerp(a12, MaxRefract, Time.deltaTime * FreezeSpeed));
}
}
else if (ScreenFreezeFX | (currentWeatherName == Volume_Weather_types.FreezeStorm))
{
float a13 = ScreenRainDropsMat.GetFloat("_Speed");
ScreenRainDropsMat.SetFloat("_Speed", Mathf.Lerp(a13, 0f, Time.deltaTime * FreezeSpeed));
float a14 = ScreenRainDropsMat.GetFloat("_WaterAmount");
ScreenRainDropsMat.SetFloat("_WaterAmount", Mathf.Lerp(a14, MaxWater, Time.deltaTime * FreezeSpeed));
float a15 = ScreenRainDropsMat.GetFloat("_BumpAmt");
ScreenRainDropsMat.SetFloat("_BumpAmt", Mathf.Lerp(a15, MaxRefract * 4f, Time.deltaTime * FreezeSpeed));
if (FreezeInwards)
{
float a16 = ScreenRainDropsMat.GetFloat("_FreezeFacrorA");
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", Mathf.Lerp(a16, 0f, Time.deltaTime * FreezeSpeed));
float a17 = ScreenRainDropsMat.GetFloat("_FreezeFacrorB");
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", Mathf.Lerp(a17, 0f, Time.deltaTime * FreezeSpeed));
float a18 = ScreenRainDropsMat.GetFloat("_FreezeFacrorC");
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", Mathf.Lerp(a18, 1f, Time.deltaTime * FreezeSpeed));
}
else
{
float a19 = ScreenRainDropsMat.GetFloat("_FreezeFacrorA");
ScreenRainDropsMat.SetFloat("_FreezeFacrorA", Mathf.Lerp(a19, 1f, Time.deltaTime * FreezeSpeed));
float a20 = ScreenRainDropsMat.GetFloat("_FreezeFacrorB");
ScreenRainDropsMat.SetFloat("_FreezeFacrorB", Mathf.Lerp(a20, 1f, Time.deltaTime * FreezeSpeed));
float a21 = ScreenRainDropsMat.GetFloat("_FreezeFacrorC");
ScreenRainDropsMat.SetFloat("_FreezeFacrorC", Mathf.Lerp(a21, 0f, Time.deltaTime * FreezeSpeed));
}
}
else
{
float a22 = ScreenRainDropsMat.GetFloat("_WaterAmount");
ScreenRainDropsMat.SetFloat("_WaterAmount", Mathf.Lerp(a22, 0f, Time.deltaTime * FreezeSpeed));
float a23 = ScreenRainDropsMat.GetFloat("_BumpAmt");
ScreenRainDropsMat.SetFloat("_BumpAmt", Mathf.Lerp(a23, 0f, Time.deltaTime * FreezeSpeed));
}
}
if ((!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
float intensity = SUPPORT_LIGHT.GetComponent<Light>().intensity;
if (intensity < 0.2f)
{
SUPPORT_LIGHT.GetComponent<Light>().intensity = Mathf.Lerp(intensity, 0.2f, Time.deltaTime);
}
float intensity2 = MOON_LIGHT.GetComponent<Light>().intensity;
if (intensity2 > 0f)
{
MOON_LIGHT.GetComponent<Light>().intensity = Mathf.Lerp(intensity2, 0f, Time.deltaTime);
}
}
else
{
float intensity3 = SUPPORT_LIGHT.GetComponent<Light>().intensity;
if (intensity3 > 0f)
{
SUPPORT_LIGHT.GetComponent<Light>().intensity = Mathf.Lerp(intensity3, 0f, Time.deltaTime);
}
float intensity4 = MOON_LIGHT.GetComponent<Light>().intensity;
if (intensity4 != max_moon_intensity)
{
MOON_LIGHT.GetComponent<Light>().intensity = Mathf.Lerp(intensity4, max_moon_intensity, Time.deltaTime * 0.05f);
}
}
if (MoonPhases && MoonPhasesMat != null)
{
float num155 = 0f;
if (AutoMoonLighting && Camera.main != null)
{
Vector3 normalized = (MoonObj.transform.position - Camera.main.transform.position).normalized;
Vector3 normalized2 = (SunObj.transform.position - MoonObj.transform.position).normalized;
Vector3 lhs = -Camera.main.transform.up;
Vector3 right = Camera.main.transform.right;
float num156 = Mathf.Atan2(Vector3.Dot(lhs, Vector3.Cross(normalized, normalized2)), Vector3.Dot(normalized, normalized2)) * 57.29578f;
float num157 = Mathf.Atan2(Vector3.Dot(right, Vector3.Cross(normalized, normalized2)), Vector3.Dot(normalized, normalized2)) * 57.29578f;
Vector3 normalized3 = (SunObj.transform.position - Camera.main.transform.position).normalized;
float num158 = Vector3.Angle(normalized, normalized3);
float num159 = 10f;
if (num158 < 90f)
{
num159 = -1f;
}
if (num158 < 1.5f)
{
num155 = -2000f;
onEclipse = true;
}
else
{
onEclipse = false;
}
float z = num155 - 2200f + num159 * 20f * num158;
MoonPhasesMat.SetVector("_SunDir", Vector3.Lerp(MoonPhasesMat.GetVector("_SunDir"), new Vector3(num156 * 200f, num157 * 350f, z), Time.deltaTime * SPEED * 1.2f));
if (AutoMoonFade)
{
Color color5 = MoonPhasesMat.GetColor("_Color");
if ((!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
if (onEclipse)
{
MoonPhasesMat.SetColor("_Color", Color.Lerp(color5, new Color(MoonColor.r, MoonColor.g, MoonColor.b, 1f - MinMaxEclMoonTransp.z), Time.deltaTime));
}
else
{
MoonPhasesMat.SetColor("_Color", Color.Lerp(color5, new Color(MoonColor.r, MoonColor.g, MoonColor.b, 1f - MinMaxEclMoonTransp.y), Time.deltaTime));
}
}
else
{
MoonPhasesMat.SetColor("_Color", Color.Lerp(color5, new Color(MoonColor.r, MoonColor.g, MoonColor.b, 1f - MinMaxEclMoonTransp.x), Time.deltaTime));
}
}
else
{
Color color6 = MoonPhasesMat.GetColor("_Color");
MoonPhasesMat.SetColor("_Color", Color.Lerp(color6, MoonColor, Time.deltaTime));
}
}
else
{
float num160 = Current_Month - Current_Month / 12 * 12;
float num161 = Current_Day - (float)((int)((Current_Day + 0f) / (float)days_per_month) * days_per_month);
float num162 = -30f + num161 * 2f;
MoonPhasesMat.SetVector("_SunDir", Vector3.Lerp(MoonPhasesMat.GetVector("_SunDir"), new Vector3(num162 * 350f * 2f + 500f, num160 * 350f * 2f + 500f, num162 * 800f), Time.deltaTime * SPEED));
Color color7 = MoonPhasesMat.GetColor("_Color");
MoonPhasesMat.SetColor("_Color", Color.Lerp(color7, MoonColor, Time.deltaTime));
}
Color color8 = MoonPhasesMat.GetColor("_Ambient");
if (onEclipse)
{
MoonPhasesMat.SetColor("_Ambient", Color.Lerp(color8, Color.black, Time.deltaTime));
}
else
{
MoonPhasesMat.SetColor("_Ambient", Color.Lerp(color8, MoonAmbientColor, Time.deltaTime));
}
float a24 = MoonPhasesMat.GetFloat("_Light");
MoonPhasesMat.SetFloat("_Light", Mathf.Lerp(a24, MoonSunLight, Time.deltaTime));
float b = MoonCoverage;
if (num155 != 0f)
{
b = 0.8f;
}
float a25 = MoonPhasesMat.GetFloat("_CloudCover");
MoonPhasesMat.SetFloat("_CloudCover", Mathf.Lerp(a25, b, Time.deltaTime));
}
if (StarsMaterial != null)
{
Color color9 = StarsMaterial.GetColor("_Color");
if ((!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
if (Current_Time < 1f)
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.y));
}
else
{
StarsMaterial.SetColor("_Color", Color.Lerp(color9, new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.y), Time.deltaTime));
}
}
else if (Current_Time < 1f)
{
StarsMaterial.SetColor("_Color", new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.x));
}
else
{
StarsMaterial.SetColor("_Color", Color.Lerp(color9, new Color(StarsColor.r, StarsColor.g, StarsColor.b, 1f - MinMaxStarsTransp.x), Time.deltaTime));
}
float a26 = StarsMaterial.GetFloat("_Light");
StarsMaterial.SetFloat("_Light", Mathf.Lerp(a26, StarsIntensity, Time.deltaTime));
}
if (MoonSize != 1f)
{
MoonObj.transform.localScale = 1800f * MoonSize * Vector3.one;
}
if (disableSunAtNight)
{
if ((!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
if (!SUN_LIGHT.GetComponent<Light>().enabled)
{
SUN_LIGHT.GetComponent<Light>().enabled = true;
}
}
else if (SUN_LIGHT.GetComponent<Light>().enabled)
{
SUN_LIGHT.GetComponent<Light>().enabled = false;
}
}
float num163 = 255f;
Color a27 = Color.white;
if ((bool)cloud_downMaterial)
{
a27 = cloud_downMaterial.GetVector("_TintColor");
}
Color a28 = Color.white;
if ((bool)cloud_upMaterial)
{
a28 = cloud_upMaterial.GetVector("_TintColor");
}
Color a29 = Color.white;
if ((bool)flat_cloud_downMaterial)
{
a29 = flat_cloud_downMaterial.GetVector("_EmisColor");
}
Color a30 = Color.white;
if ((bool)flat_cloud_upMaterial)
{
a30 = flat_cloud_upMaterial.GetVector("_TintColor");
}
Color a31 = Color.white;
if ((bool)cloud_dome_downMaterial)
{
a31 = cloud_dome_downMaterial.GetVector("_TintColor");
}
Color a32 = Color.white;
Color a33 = Color.white;
Color a34 = Color.white;
Color a35 = Color.white;
float a36 = 0f;
float a37 = 0f;
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
a32 = CloudDomeL1Mat.GetVector("_Color");
a33 = CloudDomeL2Mat.GetVector("_Color");
a36 = CloudDomeL1Mat.GetFloat("_CloudCover");
a37 = CloudDomeL2Mat.GetFloat("_CloudCover");
a34 = CloudDomeL1Mat.GetVector("_Ambient");
a35 = CloudDomeL2Mat.GetVector("_Ambient");
CloudDomeL1Mat.SetFloat("_CloudDensity", L1CloudDensOffset);
CloudDomeL1Mat.SetFloat("_CloudSize", L1CloudSize);
CloudDomeL1Mat.SetFloat("_AmbientFactor", L1Ambience);
if (windZone != null)
{
Vector3 b2 = new Vector3(windZone.transform.forward.x, 0f, windZone.transform.forward.z);
CloudDomeL1.transform.forward = Vector3.Lerp(CloudDomeL1.transform.forward, b2, Time.deltaTime * 0.06f);
CloudDomeL2.transform.forward = Vector3.Lerp(CloudDomeL2.transform.forward, b2, Time.deltaTime * 0.06f);
CloudDomeL1Mat.SetVector("_CloudSpeed", Vector4.Lerp(CloudDomeL1Mat.GetVector("_CloudSpeed"), new Vector4(0f, (0f - (windZone.windMain + 5.05f)) * L12SpeedOffset * 0.4f * 0.01f, 0f, 0f), Time.deltaTime * 0.06f));
CloudDomeL2Mat.SetVector("_CloudSpeed", Vector4.Lerp(CloudDomeL2Mat.GetVector("_CloudSpeed"), new Vector4(0f, (0f - (windZone.windMain + 5.05f)) * L12SpeedOffset * 0.1f * 0.01f, 0f, 0f), Time.deltaTime * 0.06f));
}
}
Color a38 = Color.white;
if ((bool)star_dome_Material)
{
a38 = star_dome_Material.GetVector("_TintColor");
}
Color a39 = Color.white;
Color a40 = Color.white;
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
a39 = real_cloud_downMaterial.GetVector("_TintColor");
}
if ((bool)real_cloud_upMaterial)
{
a40 = real_cloud_upMaterial.GetVector("_TintColor");
}
}
float num164 = 0.1f;
bool flag4 = (AutoSunPosition && Rot_Sun_X > 0f) | (!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn)));
bool flag5 = (AutoSunPosition && Rot_Sun_X < 5f && Previous_Rot_X > Rot_Sun_X) | (!AutoSunPosition && ((Current_Time > NightTimeMax - 0.3f + Shift_dawn) | (Current_Time < 9f + Shift_dawn)));
bool flag6 = (AutoSunPosition && Rot_Sun_X < 45f && Previous_Rot_X > Rot_Sun_X) | (!AutoSunPosition && Current_Time > 17.1f + Shift_dawn);
if (flag4)
{
if (AutoSunPosition && flag6)
{
if ((bool)cloud_downMaterial)
{
cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a27, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if ((bool)cloud_upMaterial)
{
cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a28, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if (Weather == Weather_types.HeavyStormDark)
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, new Color(0.05f, 0.02f, 0.01f, 0.5f), 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, new Color(0.05f, 0.02f, 0.01f, 0.5f), 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
}
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
real_cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a39, Dusk_real_cloud_col_dn, 0.5f * Time.deltaTime));
}
if ((bool)real_cloud_upMaterial)
{
real_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a40, Dusk_real_cloud_col_up, 0.5f * Time.deltaTime));
}
}
else if (Application.isPlaying)
{
if (Real_Clouds_Dn_P != null)
{
for (int num165 = 0; num165 < Real_Clouds_Dn_P.Length; num165++)
{
ParticleSystem.MainModule main25 = Real_Clouds_Dn_P[num165].main;
main25.startColor = Color.Lerp(main25.startColor.color, Dusk_real_cloud_col_dn, 0.5f * Time.deltaTime);
}
}
if (Real_Clouds_Up_P != null)
{
for (int num166 = 0; num166 < Real_Clouds_Up_P.Length; num166++)
{
ParticleSystem.MainModule main26 = Real_Clouds_Up_P[num166].main;
main26.startColor = Color.Lerp(main26.startColor.color, Dusk_real_cloud_col_up, 0.5f * Time.deltaTime);
}
}
}
float num167 = 0.5f;
if (((Weather == Weather_types.Sunny) | (Weather == Weather_types.HeavyFog)) && On_demand)
{
num167 = 0f;
}
float num168 = 1f;
if (Weather == Weather_types.HeavyStormDark && On_demand)
{
num168 = 0.1f;
}
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color10 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color11 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color12 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num168 * new Color(color10.r, color10.g, color10.b, num167), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num168 * new Color(color12.r, color12.g, color12.b, num167), num164 * 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1.09f + L1CloudCoverOffset, num164 * 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1.08f, num164 * 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num168 * new Color(color11.r, color11.g, color11.b, num167 * 0.55f), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num168 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), num164 * 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num168 * new Color(Dusk_L1_dome_color.r, Dusk_L1_dome_color.g, Dusk_L1_dome_color.b, num167), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num168 * new Color(Dusk_L2_dome_color.r, Dusk_L2_dome_color.g, Dusk_L2_dome_color.b, num167), 0.5f * Time.deltaTime));
if (currentWeatherName == Volume_Weather_types.Sunny)
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.82f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num168 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num168 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num168 * new Color(Dusk_L1_dome_color.r, Dusk_L1_dome_color.g, Dusk_L1_dome_color.b, num167), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num168 * new Color(Dusk_L2_dome_color.r, Dusk_L2_dome_color.g, Dusk_L2_dome_color.b, num167), 0.5f * Time.deltaTime));
if (currentWeatherName == Volume_Weather_types.Sunny)
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1f, 0.5f * Time.deltaTime));
}
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num168 * new Color(0.75f * Day_L1_dome_color.r, 0.65f * Day_L1_dome_color.g, 0.75f * Day_L1_dome_color.b, num167 * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num168 * new Color(0.75f * Day_L2_dome_color.r, 0.65f * Day_L2_dome_color.g, 0.75f * Day_L2_dome_color.b, num167), 0.15f * Time.deltaTime));
}
}
if ((Season == 0) | (Season == 1))
{
if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num168 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num167), 0.5f * Time.deltaTime));
}
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
if ((Weather == Weather_types.Sunny) & On_demand)
{
if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num168 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num167), 0.5f * Time.deltaTime));
}
}
else if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num168 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num167), 0.5f * Time.deltaTime));
}
}
else if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num168 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num167), 1f * Time.deltaTime));
}
Surround_Clouds_Mat.color = Color.Lerp(Surround_Clouds_Mat.color, Dusk_surround_cloud_col, 0.5f * Time.deltaTime);
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Night_black_Color, 0.5f * Time.deltaTime));
}
else
{
if ((bool)cloud_downMaterial)
{
cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a27, Day_Color, 0.5f * Time.deltaTime));
}
if ((bool)cloud_upMaterial)
{
cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a28, Day_Color, 0.5f * Time.deltaTime));
}
if (Weather == Weather_types.HeavyStormDark)
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Storm_cloud_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Storm_cloud_Color, 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Day_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Day_Color, 0.5f * Time.deltaTime));
}
}
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
real_cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a39, new Color(1f, 1f, 1f, 0.05f), 0.5f * Time.deltaTime));
}
if ((bool)real_cloud_upMaterial)
{
real_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a40, new Color(1f, 1f, 1f, 0.05f), 0.5f * Time.deltaTime));
}
}
else if (Application.isPlaying)
{
if (Real_Clouds_Dn_P != null)
{
for (int num169 = 0; num169 < Real_Clouds_Dn_P.Length; num169++)
{
ParticleSystem.MainModule main27 = Real_Clouds_Dn_P[num169].main;
main27.startColor = Color.Lerp(main27.startColor.color, new Color(1f, 1f, 1f, 0.05f), 0.5f * Time.deltaTime);
}
}
if (Real_Clouds_Up_P != null)
{
for (int num170 = 0; num170 < Real_Clouds_Up_P.Length; num170++)
{
ParticleSystem.MainModule main28 = Real_Clouds_Up_P[num170].main;
main28.startColor = Color.Lerp(main28.startColor.color, new Color(1f, 1f, 1f, 0.05f), 0.5f * Time.deltaTime);
}
}
}
float num171 = 0.8f;
if (((Weather == Weather_types.Sunny) | (Weather == Weather_types.HeavyFog)) && On_demand)
{
num171 = 0f;
}
float num172 = 1f;
if (Weather == Weather_types.HeavyStormDark && On_demand)
{
num172 = 0.1f;
}
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color13 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color14 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color15 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num172 * new Color(color13.r, color13.g, color13.b, num171), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num172 * new Color(color15.r, color15.g, color15.b, num171), num164 * 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1.09f + L1CloudCoverOffset, num164 * 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1.08f, num164 * 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num172 * new Color(color14.r / 1.1f, color14.g / 1.1f, color14.b / 1.1f, num171 * 0.55f), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num172 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), num164 * 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num172 * new Color(Day_L1_dome_color.r, Day_L1_dome_color.g, Day_L1_dome_color.b, num171), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num172 * new Color(Day_L2_dome_color.r, Day_L2_dome_color.g, Day_L2_dome_color.b, num171), 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.693f, 0.15f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num172 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num172 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num172 * new Color(Day_L1_dome_color.r, Day_L1_dome_color.g, Day_L1_dome_color.b, num171), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num172 * new Color(Day_L2_dome_color.r, Day_L2_dome_color.g, Day_L2_dome_color.b, num171), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.693f, 0.5f * Time.deltaTime));
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num172 * new Color(0.89f * Day_L1_dome_color.r, 0.89f * Day_L1_dome_color.g, 0.89f * Day_L1_dome_color.b, num171 * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num172 * new Color(0.85f * Day_L2_dome_color.r, 0.85f * Day_L2_dome_color.g, 0.85f * Day_L2_dome_color.b, num171), 0.15f * Time.deltaTime));
}
}
if ((Season == 0) | (Season == 1))
{
if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num172 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num171), 0.5f * Time.deltaTime));
}
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num172 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
}
else if ((bool)cloud_dome_downMaterial)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num172 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num171), 1f * Time.deltaTime));
}
if ((bool)Surround_Clouds_Mat)
{
Surround_Clouds_Mat.color = Color.Lerp(Surround_Clouds_Mat.color, Day_surround_cloud_col, 0.5f * Time.deltaTime);
}
if ((bool)star_dome_Material)
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Night_black_Color, 1.5f * Time.deltaTime));
}
}
}
else if (flag5)
{
if ((bool)cloud_downMaterial)
{
cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a27, Night_Color, 2.9f * Time.deltaTime));
}
if ((bool)cloud_upMaterial)
{
cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a28, Night_Color, 2.9f * Time.deltaTime));
}
if (Weather == Weather_types.HeavyStormDark)
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Night_lum_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Night_lum_Color, 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Night_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Night_Color, 0.5f * Time.deltaTime));
}
}
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
real_cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a39, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime));
}
if ((bool)real_cloud_upMaterial)
{
real_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a40, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime));
}
}
else if (Application.isPlaying)
{
if (Real_Clouds_Dn_P != null)
{
for (int num173 = 0; num173 < Real_Clouds_Dn_P.Length; num173++)
{
ParticleSystem.MainModule main29 = Real_Clouds_Dn_P[num173].main;
main29.startColor = Color.Lerp(main29.startColor.color, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime);
}
}
if (Real_Clouds_Up_P != null)
{
for (int num174 = 0; num174 < Real_Clouds_Up_P.Length; num174++)
{
ParticleSystem.MainModule main30 = Real_Clouds_Up_P[num174].main;
main30.startColor = Color.Lerp(main30.startColor.color, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime);
}
}
}
float num175 = 0.1f;
if (((Weather == Weather_types.Sunny) | (Weather == Weather_types.HeavyFog)) && On_demand)
{
num175 = 0f;
}
float num176 = 1f;
if (Weather == Weather_types.HeavyStormDark && On_demand)
{
num176 = 0.1f;
}
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color16 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color17 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color18 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num176 * new Color(color16.r, color16.g, color16.b, num175), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num176 * new Color(color18.r, color18.g, color18.b, num175), num164 * 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1.09f + L1CloudCoverOffset, num164 * 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1.08f, num164 * 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num176 * new Color(color17.r, color17.g, color17.b, num175 * 0.55f), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num176 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), num164 * 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num176 * new Color(Night_L1_dome_color.r, Night_L1_dome_color.g, Night_L1_dome_color.b, num175), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num176 * new Color(Night_L2_dome_color.r, Night_L2_dome_color.g, Night_L2_dome_color.b, num175), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.6f, 0.5f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num176 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num176 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num176 * new Color(Night_L1_dome_color.r, Night_L1_dome_color.g, Night_L1_dome_color.b, num175), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num176 * new Color(Night_L2_dome_color.r, Night_L2_dome_color.g, Night_L2_dome_color.b, num175), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.6f, 0.5f * Time.deltaTime));
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num176 * new Color(0.35f * Day_L1_dome_color.r, 0.35f * Day_L1_dome_color.g, 0.35f * Day_L1_dome_color.b, num175 * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num176 * new Color(0.35f * Day_L2_dome_color.r, 0.35f * Day_L2_dome_color.g, 0.35f * Day_L2_dome_color.b, num175), 0.15f * Time.deltaTime));
}
}
if ((bool)cloud_dome_downMaterial)
{
if ((Season == 0) | (Season == 1))
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num176 * new Color(0f, 0f, 0f, num175), 1f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num176 * new Color(0f, 0f, 0f, 0f), 0.5f * Time.deltaTime));
}
else
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num176 * new Color(0f, 0f, 0f, num175), 1f * Time.deltaTime));
}
}
if ((bool)Surround_Clouds_Mat)
{
Surround_Clouds_Mat.color = Color.Lerp(Surround_Clouds_Mat.color, Night_surround_cloud_col, 0.5f * Time.deltaTime);
}
if (!AutoSunPosition && (bool)star_dome_Material)
{
if ((double)Current_Time > 10.5)
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Night_Color, 1f * Time.deltaTime));
}
else
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Day_Color, 0.02f * Time.deltaTime));
}
}
}
else if (!AutoSunPosition)
{
if ((bool)cloud_downMaterial)
{
cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a27, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if ((bool)cloud_upMaterial)
{
cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a28, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if (Weather == Weather_types.HeavyStormDark)
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, new Color(0.05f, 0.02f, 0.01f, 0.5f), 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, new Color(0.05f, 0.02f, 0.01f, 0.5f), 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Dusk_cloud_color, 0.5f * Time.deltaTime));
}
}
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
real_cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a39, Dusk_real_cloud_col_dn, 0.5f * Time.deltaTime));
}
if ((bool)real_cloud_upMaterial)
{
real_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a40, Dusk_real_cloud_col_up, 0.5f * Time.deltaTime));
}
}
else if (Application.isPlaying)
{
if (Real_Clouds_Dn_P != null)
{
for (int num177 = 0; num177 < Real_Clouds_Dn_P.Length; num177++)
{
ParticleSystem.MainModule main31 = Real_Clouds_Dn_P[num177].main;
main31.startColor = Color.Lerp(main31.startColor.color, Dusk_real_cloud_col_dn, 0.5f * Time.deltaTime);
}
}
if (Real_Clouds_Up_P != null)
{
for (int num178 = 0; num178 < Real_Clouds_Up_P.Length; num178++)
{
ParticleSystem.MainModule main32 = Real_Clouds_Up_P[num178].main;
main32.startColor = Color.Lerp(main32.startColor.color, Dusk_real_cloud_col_up, 0.5f * Time.deltaTime);
}
}
}
float num179 = 0.5f;
if (((Weather == Weather_types.Sunny) | (Weather == Weather_types.HeavyFog)) && On_demand)
{
num179 = 0f;
}
float num180 = 1f;
if (Weather == Weather_types.HeavyStormDark && On_demand)
{
num180 = 0.1f;
}
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color19 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color20 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color21 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num180 * new Color(color19.r, color19.g, color19.b, num179), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num180 * new Color(color21.r, color21.g, color21.b, num179), num164 * 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1.09f + L1CloudCoverOffset, num164 * 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1.08f, num164 * 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num180 * new Color(color20.r, color20.g, color20.b, num179 * 0.55f), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num180 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), num164 * 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num180 * new Color(Dusk_L1_dome_color.r, Dusk_L1_dome_color.g, Dusk_L1_dome_color.b, num179), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num180 * new Color(Dusk_L2_dome_color.r, Dusk_L2_dome_color.g, Dusk_L2_dome_color.b, num179), 0.5f * Time.deltaTime));
if (currentWeatherName == Volume_Weather_types.Sunny)
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.82f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num180 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num180 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num180 * new Color(Dusk_L1_dome_color.r, Dusk_L1_dome_color.g, Dusk_L1_dome_color.b, num179), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num180 * new Color(Dusk_L2_dome_color.r, Dusk_L2_dome_color.g, Dusk_L2_dome_color.b, num179), 0.5f * Time.deltaTime));
if (currentWeatherName == Volume_Weather_types.Sunny)
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0f, 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1f, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1f, 0.5f * Time.deltaTime));
}
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num180 * new Color(0.75f * Day_L1_dome_color.r, 0.65f * Day_L1_dome_color.g, 0.75f * Day_L1_dome_color.b, num179 * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num180 * new Color(0.75f * Day_L2_dome_color.r, 0.65f * Day_L2_dome_color.g, 0.75f * Day_L2_dome_color.b, num179), 0.15f * Time.deltaTime));
}
}
if ((bool)cloud_dome_downMaterial)
{
if ((Season == 0) | (Season == 1))
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num180 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num179), 0.5f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
if ((Weather == Weather_types.Sunny) & On_demand)
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num180 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num179), 0.5f * Time.deltaTime));
}
else
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num180 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num179), 0.5f * Time.deltaTime));
}
}
else
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num180 * new Color(Dusk_cloud_dome_color.r, Dusk_cloud_dome_color.g, Dusk_cloud_dome_color.b, num179), 1f * Time.deltaTime));
}
}
if ((bool)Surround_Clouds_Mat)
{
Surround_Clouds_Mat.color = Color.Lerp(Surround_Clouds_Mat.color, Dusk_surround_cloud_col, 0.5f * Time.deltaTime);
}
if ((bool)star_dome_Material)
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Night_black_Color, 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)cloud_downMaterial)
{
cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a27, Night_Color, 2.9f * Time.deltaTime));
}
if ((bool)cloud_upMaterial)
{
cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a28, Night_Color, 2.9f * Time.deltaTime));
}
if (Weather == Weather_types.HeavyStormDark)
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Night_lum_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Night_lum_Color, 0.5f * Time.deltaTime));
}
}
else
{
if ((bool)flat_cloud_downMaterial)
{
flat_cloud_downMaterial.SetVector("_EmisColor", Color.Lerp(a29, Night_Color, 0.5f * Time.deltaTime));
}
if ((bool)flat_cloud_upMaterial)
{
flat_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a30, Night_Color, 0.5f * Time.deltaTime));
}
}
if (!Mobile)
{
if ((bool)real_cloud_downMaterial)
{
real_cloud_downMaterial.SetVector("_TintColor", Color.Lerp(a39, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime));
}
if ((bool)real_cloud_upMaterial)
{
real_cloud_upMaterial.SetVector("_TintColor", Color.Lerp(a40, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime));
}
}
else if (Application.isPlaying)
{
if (Real_Clouds_Dn_P != null)
{
for (int num181 = 0; num181 < Real_Clouds_Dn_P.Length; num181++)
{
ParticleSystem.MainModule main33 = Real_Clouds_Dn_P[num181].main;
main33.startColor = Color.Lerp(main33.startColor.color, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime);
}
}
if (Real_Clouds_Up_P != null)
{
for (int num182 = 0; num182 < Real_Clouds_Up_P.Length; num182++)
{
ParticleSystem.MainModule main34 = Real_Clouds_Up_P[num182].main;
main34.startColor = Color.Lerp(main34.startColor.color, new Color(0f, 0f, 0f, 0.05f), 0.5f * Time.deltaTime);
}
}
}
float num183 = 0.1f;
if (((Weather == Weather_types.Sunny) | (Weather == Weather_types.HeavyFog)) && On_demand)
{
num183 = 0f;
}
float num184 = 1f;
if (Weather == Weather_types.HeavyStormDark && On_demand)
{
num184 = 0.1f;
}
if ((CloudDomeL1Mat != null) & (CloudDomeL2Mat != null))
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm)
{
Color color22 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
Color color23 = new Color(0.38431373f, 0.38431373f, 0.38431373f, 78f / 85f);
Color color24 = new Color(26f / 85f, 26f / 85f, 26f / 85f, 0.8f);
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num184 * new Color(color22.r, color22.g, color22.b, num183), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num184 * new Color(color24.r, color24.g, color24.b, num183), num164 * 0.15f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 1.09f + L1CloudCoverOffset, num164 * 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 1.08f, num164 * 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num184 * new Color(color23.r, color23.g, color23.b, num183 * 0.55f), num164 * 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num184 * new Color(Dark_storm_L2CA.r, Dark_storm_L2CA.g, Dark_storm_L2CA.b, Dark_storm_L2CA.a), num164 * 0.55f * Time.deltaTime));
}
else
{
if ((Season == 0) | (Season == 1))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num184 * new Color(Night_L1_dome_color.r, Night_L1_dome_color.g, Night_L1_dome_color.b, num183), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num184 * new Color(Night_L2_dome_color.r, Night_L2_dome_color.g, Night_L2_dome_color.b, num183), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.6f, 0.5f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num184 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num184 * new Color(1f, 1f, 1f, 0f), 0.5f * Time.deltaTime));
}
else
{
CloudDomeL1Mat.SetVector("_Color", Color.Lerp(a32, num184 * new Color(Night_L1_dome_color.r, Night_L1_dome_color.g, Night_L1_dome_color.b, num183), 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Color", Color.Lerp(a33, num184 * new Color(Night_L2_dome_color.r, Night_L2_dome_color.g, Night_L2_dome_color.b, num183), 0.5f * Time.deltaTime));
CloudDomeL1Mat.SetFloat("_CloudCover", Mathf.Lerp(a36, 0.8f + L1CloudCoverOffset, 0.5f * Time.deltaTime));
CloudDomeL2Mat.SetFloat("_CloudCover", Mathf.Lerp(a37, 0.6f, 0.5f * Time.deltaTime));
}
CloudDomeL1Mat.SetVector("_Ambient", Color.Lerp(a34, num184 * new Color(0.35f * Day_L1_dome_color.r, 0.35f * Day_L1_dome_color.g, 0.35f * Day_L1_dome_color.b, num183 * 0.55f), 0.15f * Time.deltaTime));
CloudDomeL2Mat.SetVector("_Ambient", Color.Lerp(a35, num184 * new Color(0.35f * Day_L2_dome_color.r, 0.35f * Day_L2_dome_color.g, 0.35f * Day_L2_dome_color.b, num183), 0.15f * Time.deltaTime));
}
}
if ((bool)cloud_dome_downMaterial)
{
if ((Season == 0) | (Season == 1))
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num184 * new Color(0f, 0f, 0f, num183), 1f * Time.deltaTime));
}
else if ((Season == 2) | ((Weather == Weather_types.Sunny) & On_demand))
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num184 * new Color(0f, 0f, 0f, 0f), 0.5f * Time.deltaTime));
}
else
{
cloud_dome_downMaterial.SetVector("_TintColor", Color.Lerp(a31, num184 * new Color(0f, 0f, 0f, num183), 1f * Time.deltaTime));
}
}
if ((bool)Surround_Clouds_Mat)
{
Surround_Clouds_Mat.color = Color.Lerp(Surround_Clouds_Mat.color, Night_surround_cloud_col, 0.5f * Time.deltaTime);
}
if (!AutoSunPosition && (bool)star_dome_Material)
{
if ((double)Current_Time > 10.5)
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Night_Color, 1f * Time.deltaTime));
}
else
{
star_dome_Material.SetVector("_TintColor", Color.Lerp(a38, Day_Color, 0.02f * Time.deltaTime));
}
}
}
if (Application.isPlaying)
{
Color treeA_color = new Color(255f / num163, 255f / num163, 255f / num163, 255f / num163);
Color terrain_tint = new Color(0f / num163, 0f / num163, 0f / num163, 255f / num163);
Color grass_tint = new Color(105f / num163, 105f / num163, 105f / num163, 255f / num163);
if (!Seasonal_change_auto & !On_demand)
{
if ((Season == 0) | (Season == 1))
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color spring_fog_day2 = Spring_fog_day;
float num185 = Spring_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
spring_fog_day2 = Spring_fog_day;
num185 = Spring_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
spring_fog_day2 = Spring_fog_night;
num185 = Spring_fog_night_density * Fog_Density_Mult;
}
else
{
spring_fog_day2 = Spring_fog_dusk;
num185 = Spring_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode5 = fogMode;
float fog_Density_Speed3 = Fog_Density_Speed;
Make_Fog_Appear(spring_fog_day2, num185, mode5, fog_Density_Speed3, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 2)
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color summer_fog_day = Summer_fog_day;
float num186 = Summer_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
summer_fog_day = Summer_fog_day;
num186 = Summer_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
summer_fog_day = Summer_fog_night;
num186 = Summer_fog_night_density * Fog_Density_Mult;
}
else
{
summer_fog_day = Summer_fog_dusk;
num186 = Summer_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode6 = fogMode;
float fog_Density_Speed4 = Fog_Density_Speed;
Make_Fog_Appear(summer_fog_day, num186, mode6, fog_Density_Speed4, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 3)
{
if (Use_fog)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color autumn_fog_day = Autumn_fog_day;
float num187 = Autumn_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
autumn_fog_day = Autumn_fog_day;
num187 = Autumn_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
autumn_fog_day = Autumn_fog_night;
num187 = Autumn_fog_night_density * Fog_Density_Mult;
}
else
{
autumn_fog_day = Autumn_fog_dusk;
num187 = Autumn_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode7 = fogMode;
float fog_Density_Speed5 = Fog_Density_Speed;
Make_Fog_Appear(autumn_fog_day, num187, mode7, fog_Density_Speed5, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
else if (Season == 4)
{
if (!RenderSettings.fog)
{
RenderSettings.fog = true;
}
Color winter_fog_day = Winter_fog_day;
float num188 = Winter_fog_day_density * Fog_Density_Mult;
if ((Current_Time < 18f) & (Current_Time > 9f))
{
winter_fog_day = Winter_fog_day;
num188 = Winter_fog_day_density * Fog_Density_Mult;
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
winter_fog_day = Winter_fog_night;
num188 = Winter_fog_night_density * Fog_Density_Mult;
}
else
{
winter_fog_day = Winter_fog_dusk;
num188 = Winter_fog_dusk_density * Fog_Density_Mult;
}
FogMode mode8 = fogMode;
float fog_Density_Speed6 = Fog_Density_Speed;
Make_Fog_Appear(winter_fog_day, num188, mode8, fog_Density_Speed6, 0);
}
else if (RenderSettings.fog)
{
RenderSettings.fog = false;
}
}
if ((Season_prev != Season) | !InitSeason)
{
InitSeason = true;
Seasonal_factor1_add = 0f;
Seasonal_factor2_add = 0f;
Seasonal_factor3_add = 0f;
Seasonal_factor4_add = 0f;
Seasonal_factor5_add = 0f;
Seasonal_factor6_add = 0f;
Seasonal_factor7_add = 0f;
if (!Seasonal_change_auto && LegacySeasonalFX)
{
if (Season == 3)
{
if (FallingLeaves_OBJ != null)
{
for (int num189 = 0; num189 < FallingLeaves_OBJ.Length; num189++)
{
ParticleSystem.MainModule main35 = FallingLeaves_P[num189].main;
FallingLeaves_OBJ[num189].SetActive(value: true);
main35.maxParticles = 300;
}
}
if (UnityEngine.Random.Range(1, 4) == 2)
{
if (Lower_Dynamic_Cloud != null)
{
Lower_Dynamic_Cloud.SetActive(value: true);
}
if (Upper_Dynamic_Cloud != null)
{
Upper_Dynamic_Cloud.SetActive(value: true);
}
if (Lower_Static_Cloud != null)
{
Lower_Static_Cloud.SetActive(value: true);
}
}
else
{
if (Lower_Cloud_Real != null)
{
Lower_Cloud_Real.SetActive(value: true);
}
if (Upper_Cloud_Real != null)
{
Upper_Cloud_Real.SetActive(value: true);
}
if (Lower_Dynamic_Cloud != null)
{
Lower_Dynamic_Cloud.SetActive(value: false);
}
if (Upper_Dynamic_Cloud != null)
{
Upper_Dynamic_Cloud.SetActive(value: false);
}
if (Lower_Static_Cloud != null)
{
Lower_Static_Cloud.SetActive(value: false);
}
}
}
else
{
if (Lower_Cloud_Real != null)
{
Lower_Cloud_Real.SetActive(value: false);
}
if (Upper_Cloud_Real != null)
{
Upper_Cloud_Real.SetActive(value: false);
}
if (FallingLeaves_OBJ != null)
{
for (int num190 = 0; num190 < FallingLeaves_OBJ.Length; num190++)
{
FallingLeaves_OBJ[num190].SetActive(value: false);
}
}
}
if (Season == 4)
{
if (SnowStorm_OBJ != null)
{
SnowStorm_OBJ.SetActive(value: true);
}
}
else if (SnowStorm_OBJ != null)
{
SnowStorm_OBJ.SetActive(value: false);
}
if (Season == 1)
{
if (Butterfly_OBJ != null)
{
Butterfly_OBJ.SetActive(value: true);
}
if (Lower_Dynamic_Cloud != null)
{
Lower_Dynamic_Cloud.SetActive(value: true);
}
if (Upper_Dynamic_Cloud != null)
{
Upper_Dynamic_Cloud.SetActive(value: true);
}
if (Lower_Cloud_Bed != null)
{
Lower_Cloud_Bed.SetActive(value: false);
}
if (Upper_Cloud_Bed != null)
{
Upper_Cloud_Bed.SetActive(value: false);
}
if (Lower_Static_Cloud != null)
{
Lower_Static_Cloud.SetActive(value: false);
}
if (Upper_Static_Cloud != null)
{
Upper_Static_Cloud.SetActive(value: false);
}
if (Sun_Ray_Cloud != null)
{
Sun_Ray_Cloud.SetActive(value: true);
}
}
else if (Butterfly_OBJ != null)
{
Butterfly_OBJ.SetActive(value: false);
}
}
if (Season == 0)
{
treeA_color = Tree_Spring_Col;
terrain_tint = Terrain_Spring_Col;
grass_tint = Grass_Spring_Col;
}
else if (Season == 1)
{
treeA_color = Tree_Spring_Col;
terrain_tint = Terrain_Spring_Col;
grass_tint = Grass_Spring_Col;
}
else if (Season == 2)
{
treeA_color = Tree_Summer_Col;
terrain_tint = Terrain_Summer_Col;
grass_tint = Grass_Summer_Col;
}
else if (Season == 3)
{
treeA_color = Tree_Autumn_Col;
terrain_tint = Terrain_Autumn_Col;
grass_tint = Grass_Autumn_Col;
}
else if (Season == 4)
{
treeA_color = Tree_Winter_Col;
terrain_tint = Terrain_Winter_Col;
grass_tint = Grass_Winter_Col;
}
if (Terrain_controller != null)
{
Terrain_controller.TreeA_color = treeA_color;
Terrain_controller.Terrain_tint = terrain_tint;
Terrain_controller.Grass_tint = grass_tint;
}
if (Mesh_Terrain_controller != null)
{
Mesh_Terrain_controller.TreeA_color = treeA_color;
Mesh_Terrain_controller.Terrain_tint = terrain_tint;
Mesh_Terrain_controller.Grass_tint = grass_tint;
}
Season_prev = Season;
}
}
if (Auto_Cycle_Sky)
{
Seasonal_factor1_add = 0f;
Seasonal_factor2_add = 0f;
Seasonal_factor3_add = 0f;
Seasonal_factor4_add = 0f;
Seasonal_factor5_add = 0f;
Seasonal_factor6_add = 0f;
Seasonal_factor7_add = 0f;
if ((!AutoSunPosition && ((Current_Time < 18f + Shift_dawn) & (Current_Time > 9f + Shift_dawn))) | (AutoSunPosition && Rot_Sun_X > 0f))
{
if (Star_particles_OBJ_P != null)
{
ParticleSystem.MainModule main36 = Star_particles_OBJ_P.main;
if (main36.maxParticles > 5)
{
main36.maxParticles -= 5;
}
else
{
if (Star_particles_OBJ_P.gameObject.activeInHierarchy)
{
Star_particles_OBJ_P.gameObject.SetActive(value: false);
}
if (Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: false);
}
}
}
if (Season == 4)
{
Seasonal_factor1_add = -0.5f;
Seasonal_factor2_add = -16f;
Seasonal_factor3_add = -0.0004f;
Seasonal_factor4_add = -0.014f;
Seasonal_factor5_add = 0.02f;
Seasonal_factor6_add = 0.2f;
Seasonal_factor7_add = -0.3f;
m_Coloration = Mathf.Lerp(m_Coloration, 0.2f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
}
if ((AutoSunPosition && Rot_Sun_X < 25f) | (!AutoSunPosition && Current_Time > 17f + Shift_dawn))
{
float num191 = 11f;
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Dusk_Sun_Color, 0.05f * num191 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Dusk_Sun_Color)
{
MAIN.color = Dusk_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Dusk_Ambient_Color, 0.05f * num191 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Dusk_Ambient_Color)
{
RenderSettings.ambientLight = Dusk_Ambient_Color;
}
num191 = 6f;
num191 = 4.5f;
if (!Unity5)
{
m_fExposure = Mathf.Lerp(m_fExposure, 0.8f + Seasonal_factor1_add, num191 * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 36.9f + Seasonal_factor2_add, num191 * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.0106587f + Seasonal_factor3_add, 0.05f * num191 * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.09617826f + Seasonal_factor4_add, 0.05f * num191 * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9802108f + Seasonal_factor5_add, num191 * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.1f + Seasonal_factor6_add, 0.05f * num191 * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.61f + Seasonal_factor7_add, num191 * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.7977272f, 0.5472727f, 0.5204545f), num191 * Time.deltaTime);
}
}
else if ((AutoSunPosition && Rot_Sun_X < 65f) | (!AutoSunPosition && Current_Time > 12f + Shift_dawn))
{
float num192 = 3f;
num192 = 0.7f;
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Day_Sun_Color, 0.05f * num192 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Day_Sun_Color)
{
MAIN.color = Day_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Day_Ambient_Color, 0.5f * num192 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Day_Ambient_Color)
{
RenderSettings.ambientLight = Day_Ambient_Color;
}
if (!Unity5)
{
m_fExposure = Mathf.Lerp(m_fExposure, 2.2f + Seasonal_factor1_add, num192 * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 26.19f + Seasonal_factor2_add, num192 * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.0004021739f + Seasonal_factor3_add, num192 * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.01445652f + Seasonal_factor4_add, num192 * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9263152f + Seasonal_factor5_add, num192 * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.76087f + Seasonal_factor6_add, num192 * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.7f + Seasonal_factor7_add, num192 * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.65f, 0.57f, 0.475f), num192 * Time.deltaTime);
}
}
else
{
float num193 = 3f;
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Dawn_Sun_Color, 0.05f * num193 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Dawn_Sun_Color)
{
MAIN.color = Dawn_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Dawn_Ambient_Color, 0.5f * num193 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Dawn_Ambient_Color)
{
RenderSettings.ambientLight = Dawn_Ambient_Color;
}
if (!Unity5)
{
m_fExposure = Mathf.Lerp(m_fExposure, 1.163406f + Seasonal_factor1_add, num193 * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 52.37899f + Seasonal_factor2_add, num193 * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.014f + Seasonal_factor3_add, num193 * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.030868f + Seasonal_factor4_add, num193 * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.96f + Seasonal_factor5_add, num193 * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 3f + Seasonal_factor6_add, num193 * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 48f / 115f + Seasonal_factor7_add, num193 * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.775f, 0.5927f, 0.5545f), num193 * Time.deltaTime);
}
}
}
else if ((AutoSunPosition && Rot_Sun_X < 15f) | (!AutoSunPosition && ((Current_Time <= 9f + Shift_dawn) & (Current_Time > 1f + Shift_dawn))))
{
float num194 = 0.5f;
if ((AutoSunPosition && Rot_Sun_X < 5f) | (!AutoSunPosition && Current_Time < 8.7f + Shift_dawn))
{
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Night_Sun_Color, 1.5f * num194 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Night_Sun_Color)
{
MAIN.color = Night_Sun_Color;
}
}
else if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Dawn_Sun_Color, num194 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Dawn_Sun_Color)
{
MAIN.color = Dawn_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Night_Ambient_Color, 2f * num194 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Night_Ambient_Color)
{
RenderSettings.ambientLight = Night_Ambient_Color;
}
if (!Unity5)
{
m_fExposure = Mathf.Lerp(m_fExposure, 0.2655797f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 34.61015f + Seasonal_factor2_add, 0.5f * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.0001f + Seasonal_factor3_add, 0.5f * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.0003f + Seasonal_factor4_add, 0.5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.8993674f + Seasonal_factor5_add, 0.5f * Time.deltaTime);
Sun_ring_factor = 0.005113637f;
m_fSamples = Mathf.Lerp(m_fSamples, 3.130435f + Seasonal_factor6_add, 0.5f * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.4036232f + Seasonal_factor7_add, 0.5f * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.7522727f, 0.82f, 0.7590909f), 0.5f * Time.deltaTime);
}
if ((AutoSunPosition && Rot_Sun_X < 0f) | (!AutoSunPosition && Current_Time < 8f + Shift_dawn))
{
if (Star_particles_OBJ_P != null)
{
if (!Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: true);
}
if (!Star_particles_OBJ_P.gameObject.activeInHierarchy)
{
Star_particles_OBJ_P.gameObject.SetActive(value: true);
}
ParticleSystem.MainModule main37 = Star_particles_OBJ_P.main;
if (main37.maxParticles < 1000)
{
main37.maxParticles += 5;
}
}
else
{
if (!Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: true);
}
Star_particles_OBJ_P = Star_particles_OBJ.GetComponentInChildren(typeof(ParticleSystem)) as ParticleSystem;
}
}
else if (Star_particles_OBJ_P != null)
{
if (Star_particles_OBJ_P.main.maxParticles > 5)
{
ParticleSystem.MainModule main38 = Star_particles_OBJ_P.main;
if (UnityEngine.Random.Range(1, 27) == 2)
{
main38.maxParticles -= Mathf.Max(1, (int)(5f * DawnAppearSpeed * 0.5f));
}
main38.startColor = Color.Lerp(main38.startColor.color, new Color(main38.startColor.color.r, main38.startColor.color.g, main38.startColor.color.b, 0f), Time.deltaTime * StarsPFadeSpeed * DawnAppearSpeed * SPEED);
}
else
{
if (Star_particles_OBJ_P.gameObject.activeInHierarchy)
{
Star_particles_OBJ_P.gameObject.SetActive(value: false);
}
if (Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: false);
}
}
}
}
else
{
if ((AutoSunPosition && Rot_Sun_X < 0f) | (!AutoSunPosition && ((Current_Time > NightTimeMax + Shift_dawn) | ((Current_Time >= 0f) & (Current_Time <= 1f + Shift_dawn)))))
{
if (Star_particles_OBJ_P != null)
{
if (!Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: true);
}
if (!Star_particles_OBJ_P.gameObject.activeInHierarchy)
{
Star_particles_OBJ_P.gameObject.SetActive(value: true);
}
ParticleSystem.MainModule main39 = Star_particles_OBJ_P.main;
if (main39.maxParticles < 1000)
{
main39.maxParticles += 5;
main39.startColor = Color.Lerp(main39.startColor.color, new Color(main39.startColor.color.r, main39.startColor.color.g, main39.startColor.color.b, StarsPMaxGlow), Time.deltaTime * 0.6f * SPEED);
}
}
else
{
if (!Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: true);
}
Star_particles_OBJ_P = Star_particles_OBJ.GetComponentInChildren(typeof(ParticleSystem)) as ParticleSystem;
}
}
else if (Star_particles_OBJ_P != null)
{
if (Star_particles_OBJ.activeInHierarchy)
{
Star_particles_OBJ.SetActive(value: false);
}
if (Star_particles_OBJ_P.gameObject.activeInHierarchy)
{
Star_particles_OBJ_P.gameObject.SetActive(value: false);
}
}
if (Season == 1)
{
Seasonal_factor1_add = 0f;
Seasonal_factor2_add = -14.9f;
Seasonal_factor3_add = -0.0062f;
Seasonal_factor4_add = -0.0259f;
Seasonal_factor5_add = 0.02f;
Seasonal_factor6_add = 0.9f;
Seasonal_factor7_add = -0.1f;
m_Coloration = Mathf.Lerp(m_Coloration, 0.12f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
}
float num195 = 0.5f;
if (!Unity5)
{
if (Preset == 0)
{
m_fExposure = Mathf.Lerp(m_fExposure, 0.8f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 36.9f + Seasonal_factor2_add, 0.5f * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.0106587f + Seasonal_factor3_add, 0.5f * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.09617826f + Seasonal_factor4_add, 0.5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9802108f + Seasonal_factor5_add, 0.5f * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.1f + Seasonal_factor6_add, 0.5f * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.61f + Seasonal_factor7_add, 0.5f * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.7977272f, 0.5472727f, 0.5204545f), 0.5f * Time.deltaTime);
}
else if (Preset == 1)
{
m_fExposure = Mathf.Lerp(m_fExposure, 0.8213768f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 22.21884f + Seasonal_factor2_add, 0.5f * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.01077681f + Seasonal_factor3_add, 0.5f * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.02707681f + Seasonal_factor4_add, 0.5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9572327f + Seasonal_factor5_add, 0.5f * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.695652f + Seasonal_factor6_add, 0.5f * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.4036232f + Seasonal_factor7_add, 0.5f * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(1f, 0.5472732f, 0.5204539f), 0.5f * Time.deltaTime);
}
else
{
m_fExposure = Mathf.Lerp(m_fExposure, 0.8213768f + Seasonal_factor1_add, 0.5f * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 22.21884f + Seasonal_factor2_add, 0.5f * Time.deltaTime);
m_Kr = Mathf.Lerp(m_Kr, 0.01077681f + Seasonal_factor3_add, 0.5f * Time.deltaTime);
m_Km = Mathf.Lerp(m_Km, 0.02707681f + Seasonal_factor4_add, 0.5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9572327f + Seasonal_factor5_add, 0.5f * Time.deltaTime);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.695652f + Seasonal_factor6_add, 0.5f * Time.deltaTime);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.4036232f + Seasonal_factor7_add, 0.5f * Time.deltaTime);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(1f, 0.5472732f, 0.5204539f), 0.5f * Time.deltaTime);
}
}
if ((AutoSunPosition && Rot_Sun_X < 0f) | (!AutoSunPosition && ((Current_Time > 22f + Shift_dawn) | ((Current_Time >= 0f) & (Current_Time <= 1f + Shift_dawn)))))
{
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Night_Sun_Color, 1.5f * num195 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Night_Sun_Color)
{
MAIN.color = Night_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Night_Ambient_Color, 2f * num195 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Night_Ambient_Color)
{
RenderSettings.ambientLight = Night_Ambient_Color;
}
}
else
{
if (Application.isPlaying)
{
MAIN.color = Color.Lerp(MAIN.color, Dusk_Sun_Color, 0.5f * num195 * Time.deltaTime * SPEED);
}
else if (MAIN.color != Dusk_Sun_Color)
{
MAIN.color = Dusk_Sun_Color;
}
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, Dusk_Ambient_Color, 0.5f * num195 * Time.deltaTime);
}
else if (RenderSettings.ambientLight != Dusk_Ambient_Color)
{
RenderSettings.ambientLight = Dusk_Ambient_Color;
}
}
}
if (USE_SKYBOX)
{
if ((Current_Time < 18f) & (Current_Time > 9f))
{
if (!(Current_Time > 16f))
{
_ = Current_Time;
_ = 12f;
}
mSunSize = Mathf.Lerp(mSunSize, 10f, 0.5f * Time.deltaTime);
mSunTint = Vector4.Lerp(mSunTint, new Vector4(255f / num163, 148f / num163, 27f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyExponent = Mathf.Lerp(mSkyExponent, 1.72f, 0.5f * Time.deltaTime);
mSkyTopColor = Vector4.Lerp(mSkyTopColor, new Vector4(100f / num163, 5f / num163, 129f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyMidColor = Vector4.Lerp(mSkyMidColor, new Vector4(125f / num163, 128f / num163, 219f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyEquatorColor = Vector4.Lerp(mSkyEquatorColor, new Vector4(89f / num163, 126f / num163, 124f / num163, 255f / num163), 0.5f * Time.deltaTime);
mGroundColor = Vector4.Lerp(mGroundColor, new Vector4(94f / num163, 65f / num163, 53f / num163, 255f / num163), 0.5f * Time.deltaTime);
}
else if ((Current_Time <= 9f) & (Current_Time > 0f))
{
mSunSize = Mathf.Lerp(mSunSize, 5f, 0.5f * Time.deltaTime);
mSunTint = Vector4.Lerp(mSunTint, new Vector4(255f / num163, 250f / num163, 244f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyExponent = Mathf.Lerp(mSkyExponent, 0.72f, 0.5f * Time.deltaTime);
mSkyTopColor = Vector4.Lerp(mSkyTopColor, new Vector4(0f / num163, 5f / num163, 0f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyMidColor = Vector4.Lerp(mSkyMidColor, new Vector4(0f / num163, 0f / num163, 0f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyEquatorColor = Vector4.Lerp(mSkyEquatorColor, new Vector4(0f / num163, 0f / num163, 0f / num163, 255f / num163), 0.5f * Time.deltaTime);
mGroundColor = Vector4.Lerp(mGroundColor, new Vector4(0f / num163, 0f / num163, 0f / num163, 255f / num163), 0.5f * Time.deltaTime);
}
else
{
mSunSize = Mathf.Lerp(mSunSize, 10f, 0.5f * Time.deltaTime);
mSunTint = Vector4.Lerp(mSunTint, new Vector4(255f / num163, 148f / num163, 27f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyExponent = Mathf.Lerp(mSkyExponent, 1.72f, 0.5f * Time.deltaTime);
mSkyTopColor = Vector4.Lerp(mSkyTopColor, new Vector4(100f / num163, 5f / num163, 129f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyMidColor = Vector4.Lerp(mSkyMidColor, new Vector4(125f / num163, 128f / num163, 219f / num163, 255f / num163), 0.5f * Time.deltaTime);
mSkyEquatorColor = Vector4.Lerp(mSkyEquatorColor, new Vector4(89f / num163, 126f / num163, 124f / num163, 255f / num163), 0.5f * Time.deltaTime);
mGroundColor = Vector4.Lerp(mGroundColor, new Vector4(94f / num163, 65f / num163, 53f / num163, 255f / num163), 0.5f * Time.deltaTime);
}
}
if (Weather == Weather_types.HeavyStormDark)
{
m_fExposure = Mathf.Lerp(m_fExposure, 0f, 1.88f * Time.deltaTime);
m_ESun = Mathf.Lerp(m_ESun, 1f, 1.88f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.5f, 0.28f * Time.deltaTime);
m_TintColor = Color.Lerp(m_TintColor, Color.black, 1.88f * Time.deltaTime);
if (Application.isPlaying)
{
RenderSettings.ambientLight = Color.Lerp(RenderSettings.ambientLight, new Color(0.07f, 0.07f, 0.07f, 0.1f), 0.5f * Time.deltaTime);
}
else if (RenderSettings.ambientLight != new Color(0.07f, 0.07f, 0.07f, 0.1f))
{
RenderSettings.ambientLight = new Color(0.07f, 0.07f, 0.07f, 0.1f);
}
if (Application.isPlaying)
{
MAIN.intensity = Mathf.Lerp(MAIN.intensity, 0.02f, 0.5f * Time.deltaTime);
}
else if (MAIN.intensity != 0.02f)
{
MAIN.intensity = 0.02f;
}
if ((bool)star_dome_Material)
{
star_dome_Material.color = Color.black;
}
if (Star_particles_OBJ_P != null)
{
ParticleSystem.MainModule main40 = Star_particles_OBJ_P.main;
if (main40.maxParticles > 5)
{
main40.maxParticles -= 10;
}
}
if (MoonObj != null && MoonObj.activeInHierarchy)
{
MoonObj.SetActive(value: false);
}
}
else
{
if (flag4)
{
float num196 = Max_sun_intensity;
if (((currentWeatherName == Volume_Weather_types.HeavyStorm) | (currentWeatherName == Volume_Weather_types.HeavyStormDark)) || (AutoMoonLighting && onEclipse))
{
num196 = Max_sun_intensity / 3f;
}
if ((currentWeatherName == Volume_Weather_types.Rain) | (currentWeatherName == Volume_Weather_types.SnowStorm))
{
num196 = Max_sun_intensity / 1.5f;
}
if (Application.isPlaying)
{
MAIN.intensity = Mathf.Lerp(MAIN.intensity, num196, To_max_intensity_speed * Time.deltaTime);
}
else if (MAIN.intensity != num196)
{
MAIN.intensity = num196;
}
}
else if (Application.isPlaying)
{
MAIN.intensity = Mathf.Lerp(MAIN.intensity, Min_sun_intensity, To_min_intensity_speed * Time.deltaTime);
}
else if (MAIN.intensity != Min_sun_intensity)
{
MAIN.intensity = Min_sun_intensity;
}
if (MoonObj != null && !MoonObj.activeInHierarchy)
{
MoonObj.SetActive(value: true);
}
}
_ = SPEED;
_ = 0f;
float num197 = 2.2f * Time.deltaTime;
if (Unity5)
{
Run_presets();
}
else
{
if ((Current_Time < 22f) & (Current_Time > 9f))
{
if (Preset == 0)
{
if (Current_Time < 17f)
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.14f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 7f, num197);
m_ESun = Mathf.Lerp(m_ESun, 35.38f, num197);
m_TintColor = Color.Lerp(m_TintColor, new Color(40f / 51f, 0.7921569f, 67f / 85f, 1f), num197);
}
else if (Current_Time < 21f)
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.11f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 6f, num197);
m_ESun = Mathf.Lerp(m_ESun, 30.38f, num197);
m_TintColor = Color.Lerp(m_TintColor, new Color(0.4745098f, 0.4392157f, 37f / 85f, 1f), num197);
}
else
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.1f, num197 / 5f);
m_fExposure = Mathf.Lerp(m_fExposure, 4f, num197 / 5f);
m_ESun = Mathf.Lerp(m_ESun, 26.38f, num197 / 5f);
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num197 / 5f);
}
m_Kr = Mathf.Lerp(m_Kr, 0.0036f, num197);
m_Km = 0.0044f;
m_g = Mathf.Lerp(m_g, -0.94f, num197);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 1.93f, num197);
m_fRayleighScaleDepth = 0.52f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.4286f, 0.5f, 0.8f), num197 * 8f);
}
if (Preset == 3)
{
if (Current_Time < 17f)
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.014f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 7f, num197);
m_ESun = Mathf.Lerp(m_ESun, 35.38f, num197);
m_TintColor = Color.Lerp(m_TintColor, new Color(40f / 51f, 0.7921569f, 67f / 85f, 1f), num197);
}
else if (Current_Time < 21f)
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.011f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 6f, num197);
m_ESun = Mathf.Lerp(m_ESun, 30.38f, num197);
m_TintColor = Color.Lerp(m_TintColor, new Color(0.4745098f, 0.4392157f, 37f / 85f, 1f), num197);
}
else
{
m_Coloration = Mathf.Lerp(m_Coloration, 0.01f, num197 / 5f);
m_fExposure = Mathf.Lerp(m_fExposure, 4f, num197 / 5f);
m_ESun = Mathf.Lerp(m_ESun, 26.38f, num197 / 5f);
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num197 / 5f);
}
m_Kr = Mathf.Lerp(m_Kr, 0.0036f, num197);
m_Km = 0.012f;
m_g = Mathf.Lerp(m_g, -0.94f, num197);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 1.93f, num197);
m_fRayleighScaleDepth = 0.52f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.43f, 0.5f, 0.3f), num197 * 8f);
}
}
else if ((Current_Time <= 9f) & (Current_Time > 1f))
{
m_TintColor = Color.Lerp(m_TintColor, Color.black, num197);
m_Coloration = Mathf.Lerp(m_Coloration, 0.03f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 0.8f, num197);
m_ESun = Mathf.Lerp(m_ESun, 5.03f, num197);
m_Kr = Mathf.Lerp(m_Kr, 0.06f, num197);
m_Km = 0.0044f;
m_g = Mathf.Lerp(m_g, -0.99f, num197);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 2.53f, num197);
m_fRayleighScaleDepth = 0.49f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.44f, 0.48f, 0.41f), num197);
}
else
{
if (Preset == 0)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num197);
m_Coloration = Mathf.Lerp(m_Coloration, 0.1f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 2f, num197);
m_ESun = Mathf.Lerp(m_ESun, 22.38f, num197);
m_Kr = Mathf.Lerp(m_Kr, 0.0036f, num197);
m_Km = 0.0044f;
m_g = Mathf.Lerp(m_g, -0.94f, num197);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 1.93f, num197);
m_fRayleighScaleDepth = 0.52f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.4286f, 0.5f, 0.8f), num197);
}
if (Preset == 3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num197);
m_Coloration = Mathf.Lerp(m_Coloration, 0.01f, num197);
m_fExposure = Mathf.Lerp(m_fExposure, 2f, num197);
m_ESun = Mathf.Lerp(m_ESun, 22.38f, num197);
m_Kr = Mathf.Lerp(m_Kr, 0.0036f, num197);
m_Km = 0.012f;
m_g = Mathf.Lerp(m_g, -0.94f, num197);
Sun_ring_factor = 0f;
m_fSamples = Mathf.Lerp(m_fSamples, 1.93f, num197);
m_fRayleighScaleDepth = 0.52f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.43f, 0.5f, 0.3f), num197);
}
}
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
}
}
if (!USE_SKYCUBE)
{
if (skyMat != null)
{
Assign_Material_Props(skyMat, Cam_tranform.position);
Assign_Material_PropsS(skyMat, Cam_tranform.position);
}
if (skyboxMat != null && Cam_tranform != null)
{
Vector3 position = Cam_tranform.position;
if (!Application.isPlaying && init_scene)
{
if (Camera.current == null)
{
cut_off_main_cam = false;
position = Cam_tranform.position;
if (Application.isEditor)
{
position = prev_scene_cam_pos;
}
}
else
{
position = Camera.current.transform.position;
}
prev_scene_cam_pos = Cam_tranform.position;
}
if ((Time.fixedTime - last_mat_update > Update_mat_every) | (!Application.isPlaying && !cut_off_main_cam))
{
last_mat_update = Time.fixedTime;
Assign_Material_Props(skyboxMat, position);
init_scene = true;
}
Assign_Material_PropsS(skyboxMat, position);
}
}
}
if (skyboxMat != null && RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
if (USE_SKYCUBE & Application.isPlaying)
{
if (Time.fixedTime - lastReflectTime > ReflectEvery)
{
if (SkyCam == null)
{
SkyCam = new Camera();
}
if (SkyCamOBJ == null)
{
SkyCamOBJ = new GameObject("SkyMasterCam", typeof(Camera));
}
SkyCam = SkyCamOBJ.GetComponent(typeof(Camera)) as Camera;
SkyCam_transform = SkyCamOBJ.transform;
if (SkyDomeSystem != null)
{
if (skyMat != null)
{
Assign_Material_Props(skyMat, SkyCam_transform.position);
Assign_Material_PropsS(skyMat, SkyCam_transform.position);
}
if (skyboxMat != null)
{
Assign_Material_Props(skyboxMat, SkyCam_transform.position);
Assign_Material_PropsS(skyboxMat, SkyCam_transform.position);
}
}
else
{
if (skyMat != null)
{
Assign_Material_Props(skyMat, Cam_tranform.position);
Assign_Material_PropsS(skyMat, Cam_tranform.position);
}
if (skyboxMat != null)
{
Assign_Material_Props(skyboxMat, Cam_tranform.position);
Assign_Material_PropsS(skyboxMat, Cam_tranform.position);
}
}
lastReflectTime = Time.fixedTime;
SkyCam.farClipPlane = ReflectCamfarClip;
SkyCam.nearClipPlane = 0.3f;
SkyCam.aspect = 1f;
if (ReflectSkybox)
{
SkyCam.clearFlags = CameraClearFlags.Skybox;
}
else
{
SkyCam.clearFlags = CameraClearFlags.Depth;
}
SkyCam.backgroundColor = Color.black;
SkyCam.enabled = false;
SkyCam.cullingMask = SkyboxLayer;
Vector3 zero = Vector3.zero;
SkyCam_transform.position = Test_Cubemap.transform.position + zero;
SkyCam_transform.rotation = Quaternion.identity;
bool fog = RenderSettings.fog;
RenderSettings.fog = false;
if (CubeTexture == null)
{
CubeTexture = new Cubemap(256, TextureFormat.ARGB32, mipChain: false);
CUBE_Mat.SetTexture("_Tex", CubeTexture);
}
CubeTexture.wrapMode = TextureWrapMode.Clamp;
SkyCam.RenderToCubemap(CubeTexture);
Test_Cubemap.GetComponent<Renderer>().sharedMaterial.SetTexture("_Cube", CubeTexture);
for (int num198 = 0; num198 < AssignCubeMapMats.Count; num198++)
{
Material material = AssignCubeMapMats[num198];
if (material.HasProperty("_Cube"))
{
material.SetTexture("_Cube", CubeTexture);
}
}
UnityEngine.Object.DestroyImmediate(SkyCamOBJ);
RenderSettings.fog = fog;
}
else
{
if (skyMat != null)
{
Assign_Material_Props(skyMat, Cam_tranform.position);
Assign_Material_PropsS(skyMat, Cam_tranform.position);
}
if (skyboxMat != null)
{
if (Time.fixedTime - last_mat_update > Update_mat_every)
{
last_mat_update = Time.fixedTime;
Assign_Material_Props(skyboxMat, Cam_tranform.position);
}
Assign_Material_PropsS(skyboxMat, Cam_tranform.position);
}
}
}
_ = (Camera.current != null) & Application.isEditor;
if (updateSkyAmbient && Time.fixedTime - lastAmbientUpdateTime > AmbientUpdateEvery)
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm || currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
RenderSettings.ambientIntensity = AmbientIntensity / 2f;
}
else
{
DynamicGI.UpdateEnvironment();
RenderSettings.ambientMode = AmbientMode.Skybox;
RenderSettings.ambientIntensity = AmbientIntensity;
}
lastAmbientUpdateTime = Time.fixedTime;
}
if (SunFollowHero && Hero != null)
{
SunSystem.transform.position = new Vector3(SunSystem.transform.position.x, Hero.position.y, SunSystem.transform.position.z);
}
}
public void OnDrawGizmos()
{
if (!Application.isPlaying && init_presets && init_scene)
{
cut_off_main_cam = false;
if (Camera.current != null && Camera.main != null && Camera.current == Camera.main && Camera.current.transform.position != prev_scene_cam_pos)
{
Assign_Material_Props(skyboxMat, Camera.current.transform.position);
Assign_Material_PropsS(skyboxMat, Camera.current.transform.position);
cut_off_main_cam = true;
prev_scene_cam_pos = Camera.current.transform.position;
}
}
}
private void Run_presets()
{
float num = Time.deltaTime * SPEED;
_ = SPEED;
_ = 1f;
if (!Application.isPlaying | !init_presets)
{
num = 4000f;
}
if (instaChangeSkyColor)
{
num = 100000f;
}
if (!Application.isPlaying && Rot_Sun_X == Previous_Rot_X && !UseGradients && AutoSunPosition)
{
return;
}
bool flag = (AutoSunPosition && Rot_Sun_X > 0f) | (!AutoSunPosition && ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= NightTimeMax + Shift_dawn)));
bool flag2 = (AutoSunPosition && Rot_Sun_X < 5f && Previous_Rot_X > Rot_Sun_X) | (!AutoSunPosition && Current_Time > NightTimeMax - 0.3f + Shift_dawn);
bool flag3 = (AutoSunPosition && Rot_Sun_X < 45f && Previous_Rot_X > Rot_Sun_X) | (!AutoSunPosition && Current_Time > 17.1f + Shift_dawn);
bool flag4 = (AutoSunPosition && Rot_Sun_X < 10f) | (!AutoSunPosition && Current_Time < 10f + Shift_dawn);
bool flag5 = (AutoSunPosition && Rot_Sun_X < 15f) | (!AutoSunPosition && Current_Time < 11f + Shift_dawn);
bool flag6 = (AutoSunPosition && Rot_Sun_X < 60f && Previous_Rot_X < Rot_Sun_X) | (!AutoSunPosition && Current_Time < 16.1f + Shift_dawn);
bool flag7 = (AutoSunPosition && Rot_Sun_X < 5f) | (!AutoSunPosition && Current_Time < 8.5f + Shift_dawn);
bool flag8 = (AutoSunPosition && Rot_Sun_X < 3f) | (!AutoSunPosition && Current_Time > 23f + Shift_dawn);
bool flag9 = (AutoSunPosition && Rot_Sun_X < 5f) | (!AutoSunPosition && Current_Time > NightTimeMax + Shift_dawn);
bool flag10 = (AutoSunPosition && Rot_Sun_X < 15f) | (!AutoSunPosition && ((Current_Time > 19f + Shift_dawn) & (Current_Time < 23f + Shift_dawn)));
if (Preset == 0)
{
if (flag)
{
m_fExposure = 1.6f;
if (flag2)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (flag3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.008510659f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (flag4)
{
num *= DawnAppearSpeed;
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.32f);
scale_dif = 0.09f;
}
}
else if (flag5)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.005510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.45f, 0.41f, 0.39f);
scale_dif = 0.16f;
}
}
else if (flag6)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.07f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0318f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.16f;
}
}
m_g = -0.9990211f;
m_fSamples = 0.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (flag7)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num2 = 4f;
if (!Application.isPlaying | !init_presets)
{
num2 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num2 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num2 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num2 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num2 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num2 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num2 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num2 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num2 * num);
}
else if (flag8)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num3 = 1f;
if (!Application.isPlaying | !init_presets)
{
num3 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num3 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num3 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num3 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num3 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num3 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num3 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num3 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num3 * num);
}
else
{
if (flag9)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.3f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_Km = 0.0004f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 1)
{
m_fExposure = 1.6f;
if (!Application.isPlaying | !init_presets)
{
num = 4000f;
}
if ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= 22.4f + Shift_dawn))
{
if (Current_Time > 22.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
}
else if (Current_Time > 17.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
}
else if (Current_Time < 10f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
}
else if (Current_Time < 11f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, 0.3f * num);
}
else if (Current_Time < 16.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, num * 0.1f);
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (Current_Time < 8.5f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
}
else if (Current_Time > 23f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
}
else if (Current_Time > 22.4f + Shift_dawn)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.2f * num);
}
m_Kr = 0.009510659f;
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num);
}
m_Km = 0.0004f;
m_g = -0.9990211f;
m_fSamples = 0.02f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 2)
{
m_fExposure = 1.6f;
if (!Application.isPlaying | !init_presets)
{
num = 4000f;
}
if ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= 22.4f + Shift_dawn))
{
if (Current_Time > 22.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
}
else if (Current_Time > 17.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
}
else if (Current_Time < 10f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
}
else if (Current_Time < 11f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, 0.3f * num);
}
else if (Current_Time < 16.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, num * 0.1f);
}
Sun_ring_factor = 0.1f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (Current_Time < 8.5f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
}
else if (Current_Time > 23f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.05f, num);
}
else
{
if (Current_Time > 22.4f + Shift_dawn)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.2f * num);
}
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num);
}
m_Kr = 0.009510659f;
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num);
Sun_ring_factor = 0.1f;
}
m_Km = 0.0004f;
m_g = -0.9990211f;
m_fSamples = 0.02f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.15f + SkyColorationOffset;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 3)
{
if ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= 22.4f + Shift_dawn))
{
m_fExposure = 1.6f;
if (Current_Time > 22.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_Km = Mathf.Lerp(m_Km, 0.09f, 0.5f * num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_Km = 0.09f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (Current_Time > 17.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 3.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008510659f, 0.5f * num * 0.1f);
m_Km = Mathf.Lerp(m_Km, 0.09f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.034f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.65f, 0.64f, 0.39f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.065f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.008510659f;
m_Km = 0.09f;
m_fRayleighScaleDepth = 0.034f;
m_fWaveLength = new Vector3(0.65f, 0.64f, 0.39f);
scale_dif = 0.065f;
}
}
else if (Current_Time < 10f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.32f);
scale_dif = 0.09f;
}
}
else if (Current_Time < 11f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, 0.3f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.005510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.45f, 0.41f, 0.39f);
scale_dif = 0.16f;
}
}
else if (Current_Time < 16.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.07f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0318f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.16f;
}
}
m_g = -0.9990211f;
m_fSamples = 0.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (Current_Time < 8.5f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num4 = 4f;
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num4 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num4 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num4 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num4 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num4 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num4 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num4 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num4 * num);
}
else if (Current_Time > 23f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num5 = 1f;
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num5 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num5 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num5 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num5 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num5 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num5 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num5 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num5 * num);
}
else
{
if (Current_Time > 22.4f + Shift_dawn)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.2f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 4)
{
m_fExposure = 0.92f;
if (((Current_Time > 22.4f + Shift_dawn) & (Current_Time <= 25f)) | ((Current_Time >= 0f) & (Current_Time < 9f + Shift_dawn)))
{
if (Current_Time < 5f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9995021f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
m_g = -0.9995021f;
}
}
else if (Current_Time < 9f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 7.56f, 4f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9995021f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 7.56f;
m_g = -0.9995021f;
}
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 7.56f, 1f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9502108f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 7.56f;
m_g = -0.9502108f;
}
}
}
else if (Current_Time > 16.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 7.56f, 5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9502108f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 7.56f;
m_g = -0.9502108f;
}
}
else if ((double)Current_Time > 22.1 + (double)Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 5f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9995021f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_g = -0.9995021f;
}
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 70.56f, 2f * Time.deltaTime);
m_g = Mathf.Lerp(m_g, -0.9502108f, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 70.56f;
m_g = -0.9502108f;
}
}
m_Kr = 0.004510659f;
m_Km = 0.00069617823f;
Sun_ring_factor = 0f;
m_fSamples = 1.37f;
m_fRayleighScaleDepth = 0.04161f;
m_fWaveLength = new Vector3(0.42f, 0.35f, 0.31f);
scale_dif = 0.06f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 5)
{
if ((Current_Time >= 9f + Shift_dawn) & (Current_Time <= 22.4f + Shift_dawn))
{
m_fExposure = 1.6f;
if (Current_Time > 22.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 2.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (Current_Time > 17.1f + Shift_dawn)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.008510659f;
m_fRayleighScaleDepth = 2.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (Current_Time < 10f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 2.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.32f);
scale_dif = 0.09f;
}
}
else if (Current_Time < 11f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, 0.3f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.005510659f;
m_fRayleighScaleDepth = 2.06f;
m_fWaveLength = new Vector3(0.45f, 0.41f, 0.39f);
scale_dif = 0.16f;
}
}
else if (Current_Time < 16.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 2.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.07f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.0318f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 2.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.16f;
}
}
m_g = -0.9990211f;
m_fSamples = 3.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (Current_Time < 8.5f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num6 = 4f;
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num6 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num6 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num6 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num6 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num6 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 3.02f, num6 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.025f, num6 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num6 * num);
}
else if (Current_Time > 23f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num7 = 1f;
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num7 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num7 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num7 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num7 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num7 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 3.02f, num7 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 2.025f, num7 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num7 * num);
}
else
{
if (Current_Time > 22.4f + Shift_dawn)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.2f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 2.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_Km = 0.0004f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 6)
{
m_fExposure = 3.35f;
if (((Current_Time > 22.4f + Shift_dawn) & (Current_Time <= 25f)) | ((Current_Time >= 0f) & (Current_Time < 10f + Shift_dawn)))
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * Time.deltaTime);
}
else if (Current_Time > 22.1f + Shift_dawn)
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 5f * Time.deltaTime);
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 2.46f, 2f * Time.deltaTime);
}
m_Kr = 0.0055106585f;
m_Km = 0.00069617823f;
m_g = -0.96f;
Sun_ring_factor = 0f;
m_fSamples = 0.98f;
m_fRayleighScaleDepth = 0.08f;
m_fWaveLength = new Vector3(0.42f, 0.35f, 0.31f);
scale_dif = 0.06f;
m_fOuterRadius = 10250f;
Glob_scale = 2.36f;
m_Coloration = 0f + SkyColorationOffset;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 7)
{
if (flag)
{
m_fExposure = 1.6f;
if (flag2)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
else if (flag3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(2f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.001510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.44f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.08f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.001510659f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.44f, 0.3f);
scale_dif = 0.08f;
}
}
else if (flag4)
{
num *= DawnAppearSpeed;
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.004510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.32f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.09f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.32f);
scale_dif = 0.09f;
}
}
else if (flag5)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 2f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.45f, 0.41f, 0.39f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.16f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.005510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.45f, 0.41f, 0.39f);
scale_dif = 0.16f;
}
}
else if (flag6)
{
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.003510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.07f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 1.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0318f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.42f, 0.34f, 0.3f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.06f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 1.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.16f;
}
}
m_g = -0.9990211f;
m_fSamples = 0.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (flag7)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num8 = 4f;
if (!Application.isPlaying | !init_presets)
{
num8 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num8 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num8 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num8 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num8 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num8 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num8 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num8 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num8 * num);
}
else if (flag8)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num9 = 1f;
if (!Application.isPlaying | !init_presets)
{
num9 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num9 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num9 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num9 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num9 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num9 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num9 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num9 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num9 * num);
}
else
{
if (flag9)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.3f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_Km = 0.0004f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
skyboxMat.SetColor("SunColor", Color.white);
skyboxMat.SetFloat("SunBlend", 66f);
skyboxMat.SetFloat("White_cutoff", 1.2f + White_cutoffOffset);
}
}
if (Preset == 8)
{
if (flag)
{
m_fExposure = 0.3f;
if (flag2)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.008510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag4)
{
num *= DawnAppearSpeed;
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag5)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0002f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0002f;
}
}
else if (flag6)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0618f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
m_g = -0.9990211f;
m_fSamples = 0.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (flag7)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num10 = 4f;
if (!Application.isPlaying | !init_presets)
{
num10 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num10 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num10 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num10 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num10 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num10 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num10 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num10 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num10 * num);
}
else if (flag8)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num11 = 1f;
if (!Application.isPlaying | !init_presets)
{
num11 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num11 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num11 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num11 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num11 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num11 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num11 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num11 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num11 * num);
}
else
{
if (flag9)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.3f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_Km = 0.0004f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
float num12 = 0.05f;
if (!Application.isPlaying | !init_presets)
{
num12 = 4000f;
}
if (flag10)
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.red, 0.55f * num12 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 21f, 7f * num12 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 0.99f + White_cutoffOffset, 7f * num12 * num));
}
else
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.white, num12 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 66f, num12 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 1.2f + White_cutoffOffset, num12 * num));
}
}
}
if (Preset == 9)
{
m_Km = 0.0004f;
if (flag)
{
m_fExposure = 0.3f;
m_fSamples = 0.02f;
m_g = -0.9990211f;
if (flag2)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 5f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.007510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.44f, 0.37f, 0.33f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 5f;
m_Kr = 0.007510659f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.44f, 0.37f, 0.33f);
scale_dif = 0.07f;
}
}
else if (flag4)
{
num *= DawnAppearSpeed;
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.005510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag5)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0002f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0002f;
}
}
else if (flag6)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.003510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0618f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (flag7)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num13 = 4f;
if (!Application.isPlaying | !init_presets)
{
num13 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num13 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num13 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num13 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num13 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num13 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num13 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num13 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num13 * num);
}
else if (flag8)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num14 = 1f;
if (!Application.isPlaying | !init_presets)
{
num14 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num14 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num14 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num14 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num14 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num14 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num14 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num14 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num14 * num);
}
else
{
if (flag9)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.3f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
float num15 = 0.05f;
if (!Application.isPlaying | !init_presets)
{
num15 = 4000f;
}
if (flag10)
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.white, num15 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 66f, num15 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 1.2f + White_cutoffOffset, num15 * num));
}
else
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.white, num15 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 66f, num15 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 1.2f + White_cutoffOffset, num15 * num));
}
}
}
if (Preset == 11)
{
if (flag)
{
m_fExposure = 0.41f;
if (flag2)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0.16078432f, 4f / 85f, 7f / 85f, 1f), num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.03f, num * 0.1f);
m_ESun = Mathf.Lerp(m_ESun, 0f, 1f * num * 0.2f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag3)
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, 0.5f * num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.008510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag4)
{
num *= DawnAppearSpeed;
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num);
m_Kr = Mathf.Lerp(m_Kr, 0.005510659f, num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.004510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else if (flag5)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 2f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0002f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0002f;
}
}
else if (flag6)
{
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.006510659f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.06f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(10f / 51f, 1f / 51f, 1f / 17f, 1f), 3f * num);
m_ESun = Mathf.Lerp(m_ESun, 0.66f, 1f * num * 0.1f);
m_Kr = Mathf.Lerp(m_Kr, 0.008f, num * 0.1f);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.0618f, num * 0.1f);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.48f, 0.32f, 0.28f), num * 0.1f);
scale_dif = Mathf.Lerp(scale_dif, 0.0001f, num * 0.1f);
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0.66f;
m_Kr = 0.006510659f;
m_fRayleighScaleDepth = 0.06f;
m_fWaveLength = new Vector3(0.48f, 0.32f, 0.28f);
scale_dif = 0.0001f;
}
}
m_g = -0.9990211f;
m_fSamples = 0.02f;
}
else
{
m_TintColor = Color.Lerp(m_TintColor, new Color(0f, 0f, 0f, 0f), num);
if (flag7)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 4f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num16 = 4f;
if (!Application.isPlaying | !init_presets)
{
num16 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num16 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num16 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num16 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num16 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num16 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num16 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num16 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num16 * num);
}
else if (flag8)
{
m_ESun = Mathf.Lerp(m_ESun, Moon_glow, 0.1f * num);
if (!Application.isPlaying | !init_presets)
{
m_ESun = Moon_glow;
}
float num17 = 1f;
if (!Application.isPlaying | !init_presets)
{
num17 = 4000f;
}
m_fExposure = Mathf.Lerp(m_fExposure, 0.72f, num17 * num);
m_fWaveLength = Vector3.Lerp(m_fWaveLength, new Vector3(0.312f, 0.31f, 0.31f), num17 * num);
m_Kr = Mathf.Lerp(m_Kr, 0.01851066f, num17 * num);
m_g = Mathf.Lerp(m_g, -0.9950211f, num17 * num);
scale_dif = Mathf.Lerp(scale_dif, 0.07f, num17 * num);
m_fSamples = Mathf.Lerp(m_fSamples, 0.02f, num17 * num);
m_fRayleighScaleDepth = Mathf.Lerp(m_fRayleighScaleDepth, 0.025f, num17 * num);
m_Coloration = Mathf.Lerp(m_Coloration, 0.05f + SkyColorationOffset, num17 * num);
}
else
{
if (flag9)
{
m_ESun = 0f;
}
else
{
m_ESun = Mathf.Lerp(m_ESun, 0f, 0.3f * num);
}
if (!Application.isPlaying | !init_presets)
{
m_ESun = 0f;
}
}
if (!Application.isPlaying | !init_presets)
{
m_fRayleighScaleDepth = 0.03f;
m_fWaveLength = new Vector3(0.42f, 0.34f, 0.3f);
scale_dif = 0.06f;
}
}
m_Km = 0.0004f;
m_fOuterRadius = 10250f;
if (RenderSettings.skybox != skyboxMat)
{
RenderSettings.skybox = skyboxMat;
}
m_Coloration = 0.1f + SkyColorationOffset;
Sun_ring_factor = 0f;
if (skyboxMat.HasProperty("SunColor"))
{
float num18 = 0.05f;
if (!Application.isPlaying | !init_presets)
{
num18 = 4000f;
}
if (flag10)
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.white, num18 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 66f, num18 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 1.2f + White_cutoffOffset, num18 * num));
}
else
{
skyboxMat.SetColor("SunColor", Color.Lerp(skyboxMat.GetColor("SunColor"), Color.white, num18 * num));
skyboxMat.SetFloat("SunBlend", Mathf.Lerp(skyboxMat.GetFloat("SunBlend"), 66f, num18 * num));
skyboxMat.SetFloat("White_cutoff", Mathf.Lerp(skyboxMat.GetFloat("White_cutoff"), 1.2f + White_cutoffOffset, num18 * num));
}
}
}
float num19 = Current_Time / 24f;
if (AutoSunPosition)
{
float num20 = Rot_Sun_X;
if (Rot_Sun_X - Previous_Rot_X < 0f)
{
num20 = MaxSunElevation * 2f - Rot_Sun_X;
}
float num21 = 0f;
float num22 = MaxSunElevation * 2f;
float num23 = 7f;
float num24 = 22f;
num19 = num20 * (num24 - num23) / (num22 - num21) + num23;
num19 /= 24f;
if (num19 > 1f)
{
num19 = 1f;
}
if (num19 < 0f)
{
num19 = 0f;
}
if (!Application.isPlaying && Rot_Sun_X == Previous_Rot_X)
{
num19 = calcColorTime;
}
}
calcColorTime = num19;
if (UseGradients || VolCloudGradients)
{
if (VolCloudGradients)
{
Color b = VolCloudLitGrad.Evaluate(num19);
Color b2 = VolCloudShadGrad.Evaluate(num19);
Color b3 = VolCloudFogGrad.Evaluate(num19);
if (Time.fixedTime > 1f && Application.isPlaying && !instaChangeSkyColor)
{
gradCloudLitColor = Color.Lerp(gradCloudLitColor, b, SPEED * Time.deltaTime + 0.1f);
gradCloudShadeColor = Color.Lerp(gradCloudShadeColor, b2, SPEED * Time.deltaTime + 0.1f);
gradCloudFogColor = Color.Lerp(gradCloudFogColor, b3, SPEED * Time.deltaTime + 0.1f);
}
else
{
gradCloudLitColor = b;
gradCloudShadeColor = b2;
gradCloudFogColor = b3;
}
}
if (UseGradients && SkyColorGrad != null)
{
m_TintColor = SkyTintGrad.Evaluate(num19) + new Color(tintColorOffset.x, tintColorOffset.y, tintColorOffset.z, 0f);
Color b4 = SkyColorGrad.Evaluate(num19);
if (FexposureC != null)
{
m_fExposure = FexposureC.Evaluate(num19) + 0.4f + fExposureOffset;
}
if (FscaleDiffC != null)
{
scale_dif = FscaleDiffC.Evaluate(num19) + scaleDifOffset;
}
if (FSunGC != null)
{
m_g = -0.1f * FSunGC.Evaluate(num19) - 0.9f + gOffset;
}
if (FSunringC != null)
{
Sun_ring_factor = FSunringC.Evaluate(num19) + sunRingFactorOffset;
}
if (Time.fixedTime > 1f && Application.isPlaying && !instaChangeSkyColor)
{
gradSkyColor = Color.Lerp(gradSkyColor, b4, SPEED * Time.deltaTime + 0.1f);
}
else
{
gradSkyColor = b4;
}
b4 = gradSkyColor;
CloudDomeL1Mat.SetVector("_Color", b4 * b4);
if (gradAffectsFog)
{
if (currentWeatherName == Volume_Weather_types.HeavyStorm || currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
RenderSettings.fogColor = new Color(Mathf.Pow(b4.r, FogColorPow), Mathf.Pow(b4.g, FogColorPow), Mathf.Pow(b4.b, FogColorPow)) * 0.55f;
}
else
{
RenderSettings.fogColor = new Color(Mathf.Pow(b4.r, FogColorPow), Mathf.Pow(b4.g, FogColorPow), Mathf.Pow(b4.b, FogColorPow));
}
}
if (b4.r > 0.118f)
{
b4.r = 1.118f - b4.r;
}
if (b4.g > 0.118f)
{
b4.g = 1.118f - b4.g;
}
if (b4.b > 0.118f)
{
b4.b = 1.118f - b4.b;
}
if (currentWeatherName == Volume_Weather_types.HeavyStorm || currentWeatherName == Volume_Weather_types.HeavyStormDark)
{
if (!Application.isPlaying)
{
RenderSettings.ambientIntensity = AmbientIntensity / 2f;
}
}
else
{
m_fWaveLength = new Vector3(b4.r, b4.g, b4.b) + fWaveLengthOffset;
if (!Application.isPlaying)
{
RenderSettings.ambientIntensity = AmbientIntensity;
}
}
}
VcloudSunIntensity = IntensitySun.Evaluate(calcColorTime);
VcloudLightDiff = IntensityDiff.Evaluate(calcColorTime);
VcloudFog = IntensityFog.Evaluate(calcColorTime);
}
if (!flag && (!Application.isPlaying | !init_presets))
{
m_TintColor = new Color(0f, 0f, 0f, 0f);
m_ESun = 0f;
}
}
public void ApplyType0Scatter(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.13f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = 0.005f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -12f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 3f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1005f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.22f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.0001f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(2f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType0Default(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.37f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.05f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0.02f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = 0f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 3f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1005f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.28f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.22f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.0001f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(6f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType0Default1(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.37f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.05f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0.02f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -9f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 3f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1005f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.01f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.22f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.00012f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(0f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType0Default2(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.7f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.04f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0.02f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -3f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 2f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 992f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.05f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.19f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.0002f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(6f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType0Default3(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.3f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.22f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0.15f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -9f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 3f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1020f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.01f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.2f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.00015f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(0f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType0Default4(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.9f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.4f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0.05f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -9.5f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 2.8f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1030f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.01f;
SUNMASTERAH.VolShaderCloudsH.ClearDayCoverage = -0.22f;
SUNMASTERAH.VolShaderCloudsH.CloudDensity = 0.00018f;
Vector3 eulerAngles = SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles;
SUNMASTERAH.VolShaderCloudsH.SideClouds.eulerAngles = new Vector3(0f, eulerAngles.y, eulerAngles.z);
}
public void ApplyType1Default(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.6f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 1.4f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1000f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.UpdateScatterShader = true;
SUNMASTERAH.VolShaderCloudsH.fog_depth = 0.39f;
SUNMASTERAH.VolShaderCloudsH.reileigh = 7.48f;
SUNMASTERAH.VolShaderCloudsH.mieCoefficient = 0.01f;
SUNMASTERAH.VolShaderCloudsH.mieDirectionalG = 0.41f;
SUNMASTERAH.VolShaderCloudsH.ExposureBias = 0.04f;
SUNMASTERAH.VolShaderCloudsH.K = new Vector3(1f, 0.5f, 0.5f);
}
public void ApplyType1Default1(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.6f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 1.4f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 1000f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.UpdateScatterShader = false;
SUNMASTERAH.VolShaderCloudsH.fog_depth = 0.39f;
SUNMASTERAH.VolShaderCloudsH.reileigh = 7.48f;
SUNMASTERAH.VolShaderCloudsH.mieCoefficient = 0.01f;
SUNMASTERAH.VolShaderCloudsH.mieDirectionalG = 0.6f;
SUNMASTERAH.VolShaderCloudsH.ExposureBias = 0.02f;
SUNMASTERAH.VolShaderCloudsH.K = new Vector3(111f, 1f, 1f);
}
public void ApplyType1Default2(SkyMasterManager SUNMASTERAH)
{
SUNMASTERAH.VolCloudTransp = 0.7f;
SUNMASTERAH.VolShaderCloudsH.IntensitySunOffset = -0.05f;
SUNMASTERAH.VolShaderCloudsH.IntensityDiffOffset = 0.04f;
SUNMASTERAH.VolShaderCloudsH.IntensityFogOffset = -0f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadScale.y = 2.8f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.x = 700f;
SUNMASTERAH.VolShaderCloudsH.MultiQuadHeights.y = 1f;
SUNMASTERAH.VolShaderCloudsH.ClearDayHorizon = 0.01f;
SUNMASTERAH.VolShaderCloudsH.UpdateScatterShader = false;
SUNMASTERAH.VolShaderCloudsH.fog_depth = 0.39f;
SUNMASTERAH.VolShaderCloudsH.reileigh = 7.48f;
SUNMASTERAH.VolShaderCloudsH.mieCoefficient = 0.01f;
SUNMASTERAH.VolShaderCloudsH.mieDirectionalG = 0.6f;
SUNMASTERAH.VolShaderCloudsH.ExposureBias = 0.02f;
SUNMASTERAH.VolShaderCloudsH.K = new Vector3(111f, 1f, 1f);
}
public void ApplyCloudCurvesPresetA()
{
IntensityDiff = new AnimationCurve(new Keyframe(0f, 0.4f), new Keyframe(0.374f, 0.292f), new Keyframe(0.602f, 0.255f), new Keyframe(0.757f, 0.278f), new Keyframe(0.798f, 0.271f), new Keyframe(0.869f, 0.204f), new Keyframe(0.9f, 0.5f), new Keyframe(0.944f, 0.28f), new Keyframe(1f, 0.4f));
IntensityFog = new AnimationCurve(new Keyframe(0f, 5f), new Keyframe(0.75f, 10f), new Keyframe(0.88f, 11f), new Keyframe(0.89f, 10.58f), new Keyframe(1f, 5f));
IntensitySun = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.185f, 0.127f), new Keyframe(0.668f, 0.274f), new Keyframe(0.803f, 0.365f), new Keyframe(0.827f, 0.65f), new Keyframe(0.9f, -0.1f), new Keyframe(1f, 0f));
}
public void ApplyCloudCurvesPresetB()
{
IntensityDiff = new AnimationCurve(new Keyframe(0f, 0.4f), new Keyframe(0.374f, 0.293f), new Keyframe(0.6f, 0.2766f), new Keyframe(0.757f, 0.278f), new Keyframe(0.798f, 0.2713f), new Keyframe(0.8495f, 0.2752f), new Keyframe(0.887f, 0.249f), new Keyframe(0.944f, 0.28f), new Keyframe(1f, 0.4f));
IntensityFog = new AnimationCurve(new Keyframe(0f, 5f), new Keyframe(0.75f, 10f), new Keyframe(0.883f, 10.91f), new Keyframe(1f, 5f));
IntensitySun = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.186f, 0.148f), new Keyframe(0.71f, 0.13f), new Keyframe(0.84f, 0.3f), new Keyframe(0.9f, 0.13f), new Keyframe(1f, 0f));
}
public void setMoonShader(Transform CamPos, float dimMoon)
{
float num = 0f;
if (AutoMoonLighting)
{
Vector3 normalized = (MoonObj.transform.position - CamPos.position).normalized;
Vector3 normalized2 = (SunObj.transform.position - MoonObj.transform.position).normalized;
Vector3 lhs = -CamPos.up;
Vector3 right = CamPos.right;
float num2 = Mathf.Atan2(Vector3.Dot(lhs, Vector3.Cross(normalized, normalized2)), Vector3.Dot(normalized, normalized2)) * 57.29578f;
float num3 = Mathf.Atan2(Vector3.Dot(right, Vector3.Cross(normalized, normalized2)), Vector3.Dot(normalized, normalized2)) * 57.29578f;
Vector3 normalized3 = (SunObj.transform.position - CamPos.position).normalized;
float num4 = Vector3.Angle(normalized, normalized3);
float num5 = 10f;
if (num4 < 90f)
{
num5 = -1f;
}
if (num4 < 1.5f)
{
num = -2000f;
onEclipse = true;
}
else
{
onEclipse = false;
}
float z = num - 2200f + num5 * 20f * num4;
MoonPhasesMat.SetVector("_SunDir", new Vector3(num2 * 200f, num3 * 350f, z));
Color color = MoonPhasesMat.GetColor("_Color");
color = new Color(color.r * dimMoon, color.g * dimMoon, color.b * dimMoon, 1f);
MoonPhasesMat.SetColor("_Color", MoonColor);
}
else
{
float num6 = Current_Month - Current_Month / 12 * 12;
float num7 = Current_Day - (float)((int)((Current_Day + 0f) / (float)days_per_month) * days_per_month);
float num8 = -30f + num7 * 2f;
MoonPhasesMat.SetVector("_SunDir", new Vector3(num8 * 350f * 2f + 500f - (1f - dimMoon) * 90000f, num6 * 350f * 2f + 500f - (1f - dimMoon) * 20000f, num8 * 800f + (1f - dimMoon) * 90000f));
Color color2 = MoonPhasesMat.GetColor("_Color");
color2 = 0.01f * new Color(color2.r * dimMoon * dimMoon * dimMoon, color2.g * dimMoon * dimMoon * dimMoon, color2.b * dimMoon * dimMoon * dimMoon, 1f);
MoonPhasesMat.SetColor("_Color", MoonColor);
}
}
}
}