private void UpdateClouds() { if (clouds == Clouds) { return; } clouds = Clouds; if (CameraIsOrthographic) { if (LegacyCloudScript2D != null) { if (clouds == WeatherMakerCloudType.None) { LegacyCloudScript2D.RemoveClouds(); } else { LegacyCloudScript2D.CreateClouds(); } } } else if (SkySphereScript == null) { return; } else if (clouds == WeatherMakerCloudType.None) { CloudScript.HideCloudsAnimated(CloudChangeDuration); } else if (clouds == WeatherMakerCloudType.Light) { CloudScript.ShowCloudsAnimated(CloudChangeDuration, 0.17f, 0.0f, -1.0f, -1.0f, 0.05f, (_WeatherProfile == null || _WeatherProfile.Disabled ? (Color?)null : _WeatherProfile.CloudColor)); } else if (clouds == WeatherMakerCloudType.Medium) { CloudScript.ShowCloudsAnimated(CloudChangeDuration, 0.34f, 0.0f, -1.0f, -1.0f, 0.03f, (_WeatherProfile == null || _WeatherProfile.Disabled ? (Color?)null : _WeatherProfile.CloudColor)); } else if (clouds == WeatherMakerCloudType.Heavy) { CloudScript.ShowCloudsAnimated(CloudChangeDuration, 0.75f, 0.2f, -1.0f, -1.0f, 0.011f, (_WeatherProfile == null || _WeatherProfile.Disabled ? (Color?)null : _WeatherProfile.CloudColor)); } else if (clouds == WeatherMakerCloudType.HeavyBright) { CloudScript.ShowCloudsAnimated(CloudChangeDuration, 0.68f, 0.0f, -1.0f, -1.0f, 0.0125f, (_WeatherProfile == null || _WeatherProfile.Disabled ? (Color?)null : _WeatherProfile.CloudColor)); } else { // storm CloudScript.ShowCloudsAnimated(CloudChangeDuration, 1.0f, 0.8f, -1.0f, -1.0f, 0.01f, (_WeatherProfile == null || _WeatherProfile.Disabled ? (Color?)null : _WeatherProfile.CloudColor)); } }
/// <summary> /// Cloud manager weather profile change handler /// </summary> /// <param name="oldProfile">Old profile</param> /// <param name="newProfile">New profile</param> /// <param name="transitionDelay">Transition delay</param> /// <param name="transitionDuration">Transition duration</param> public void WeatherProfileChanged(WeatherMakerProfileScript oldProfile, WeatherMakerProfileScript newProfile, float transitionDelay, float transitionDuration) { CloudScript.ShowCloudsAnimated(newProfile.CloudProfile, transitionDelay, transitionDuration); }
private void UpdateClouds() { if (clouds == Clouds) { return; } clouds = Clouds; if (CameraIsOrthographic) { if (LegacyCloudScript2D != null) { if (clouds == WeatherMakerCloudType.None) { LegacyCloudScript2D.RemoveClouds(); } else if (clouds != WeatherMakerCloudType.Custom) { LegacyCloudScript2D.CreateClouds(); } } } else if (CloudScript == null) { return; } else if (clouds == WeatherMakerCloudType.None) { CloudScript.HideCloudsAnimated(CloudChangeDuration); } // float cover, float density = -1.0f, float sharpness = -1.0f, float lightAbsorption = -1.0f, Color? color = null else if (clouds == WeatherMakerCloudType.Light) { // cover, density, sharpness, lightAbsorption // 0.17f, 0.0f, -1.0f, 0.5f CloudScript.ShowCloudsAnimated(CloudChangeDuration, "WeatherMakerCloudProfile_Light"); } else if (clouds == WeatherMakerCloudType.Medium) { // 0.34f, 0.0f, -1.0f, 0.3f CloudScript.ShowCloudsAnimated(CloudChangeDuration, "WeatherMakerCloudProfile_Medium"); } else if (clouds == WeatherMakerCloudType.Heavy) { // 0.75f, 0.2f, -1.0f, 0.11f CloudScript.ShowCloudsAnimated(CloudChangeDuration, "WeatherMakerCloudProfile_HeavyDark"); } else if (clouds == WeatherMakerCloudType.HeavyBright) { // 0.68f, 0.0f, -1.0f, 0.125f CloudScript.ShowCloudsAnimated(CloudChangeDuration, "WeatherMakerCloudProfile_HeavyBright"); } else if (clouds == WeatherMakerCloudType.Storm) { // 1.0f, 0.8f, -1.0f, 0.1f, CloudScript.ShowCloudsAnimated(CloudChangeDuration, "WeatherMakerCloudProfile_Storm"); } else { // custom clouds, do not modify current cloud script state } }