Beispiel #1
0
    public override void OnInspectorGUI()
    {
        myTarget = (EnviroSky)target;
        //int daysInyear = (int)(myTarget.seasonsSettings.SpringInDays + myTarget.seasonsSettings.SummerInDays + myTarget.seasonsSettings.AutumnInDays + myTarget.seasonsSettings.WinterInDays);
        //Set up the box style
        if (boxStyle == null)
        {
            boxStyle = new GUIStyle(GUI.skin.box);
            boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
            boxStyle.fontStyle        = FontStyle.Bold;
            boxStyle.alignment        = TextAnchor.UpperLeft;
        }

        if (boxStyleModified == null)
        {
            boxStyleModified = new GUIStyle(GUI.skin.box);
            boxStyleModified.normal.textColor = GUI.skin.label.normal.textColor;
            boxStyleModified.fontStyle        = FontStyle.Bold;
            boxStyleModified.alignment        = TextAnchor.UpperLeft;
        }

        //Setup the wrap style
        if (wrapStyle == null)
        {
            wrapStyle           = new GUIStyle(GUI.skin.label);
            wrapStyle.fontStyle = FontStyle.Bold;
            wrapStyle.wordWrap  = true;
        }

        if (headerStyle == null)
        {
            headerStyle           = new GUIStyle(GUI.skin.label);
            headerStyle.fontStyle = FontStyle.Bold;
            headerStyle.alignment = TextAnchor.UpperLeft;
        }

        GUILayout.BeginVertical("Enviro - Sky and Weather 1.9.1", boxStyle);
        GUILayout.Space(20);
        GUILayout.BeginVertical("Profile", boxStyle);
        GUILayout.Space(20);
        myTarget.profile = (EnviroProfile)EditorGUILayout.ObjectField(myTarget.profile, typeof(EnviroProfile), false);
        GUILayout.Space(10);
        if (myTarget.profile != null)
        {
            EditorGUILayout.LabelField("Profile Version:", myTarget.profile.version);
        }
        else
        {
            EditorGUILayout.LabelField("No Profile Assigned!");
        }
        EditorGUILayout.LabelField("Prefab Version:", myTarget.prefabVersion);
        GUILayout.Space(10);
        // Runtime Settings
        if (GUILayout.Button("Apply all Settings"))
        {
            myTarget.enabled = false;
            myTarget.enabled = true;
        }
        GUILayout.EndHorizontal();
        if (myTarget.profile != null)
        {
            if (myTarget.profile.modified)             // Change color when modified
            {
                GUI.backgroundColor = modifiedColor;
            }
            GUILayout.BeginVertical("", boxStyle);
            if (myTarget.profile.modified)
            {
                GUI.backgroundColor = Color.white;
            }
                        #if UNITY_5_6_OR_NEWER
            serializedObj.UpdateIfRequiredOrScript();
                        #else
            serializedObj.UpdateIfDirtyOrScript();
                        #endif
            myTarget.showSettings = EditorGUILayout.BeginToggleGroup(" Edit Profile", myTarget.showSettings);
            if (myTarget.showSettings)
            {
                GUILayout.BeginVertical("", boxStyle);
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Save to Profile"))
                {
                    myTarget.SaveProfile();
                    myTarget.profile.modified = false;
                }
                if (GUILayout.Button("Load from Profile"))
                {
                    myTarget.ApplyProfile(myTarget.profile);
                    myTarget.profile.modified = false;
                                        #if UNITY_5_6_OR_NEWER
                    serializedObj.UpdateIfRequiredOrScript();
                                        #else
                    serializedObj.UpdateIfDirtyOrScript();
                                        #endif
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(10);
                EditorGUILayout.LabelField("Category", headerStyle);
                myTarget.profile.viewMode = (EnviroProfile.settingsMode)EditorGUILayout.EnumPopup(myTarget.profile.viewMode);
                GUILayout.EndVertical();

                switch (myTarget.profile.viewMode)
                {
                case EnviroProfile.settingsMode.Lighting:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(lightColorGradient, true, null);
                    EditorGUILayout.PropertyField(lightIntensityCurve, true, null);
                    EditorGUILayout.PropertyField(shadowStrength, true, null);
                    EditorGUILayout.PropertyField(ambientMode, true, null);
                    EditorGUILayout.PropertyField(ambientIntensityCurve, true, null);
                    EditorGUILayout.PropertyField(ambientSkyGradient, true, null);
                    EditorGUILayout.PropertyField(ambientEquatorGradient, true, null);
                    EditorGUILayout.PropertyField(ambientGroundGradient, true, null);
                    EditorGUILayout.PropertyField(reflectionBool, true, null);
                    EditorGUILayout.PropertyField(reflectionIntensity, true, null);
                    EditorGUILayout.PropertyField(reflectionUpdate, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsMode.Sky:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(skyboxMode, true, null);
                    EditorGUILayout.PropertyField(customSkyboxMaterial, true, null);
                    EditorGUILayout.PropertyField(customSkyboxColor, true, null);
                    GUILayout.Space(10);
                    EditorGUILayout.LabelField("Scattering", headerStyle);
                    myTarget.skySettings.waveLength = EditorGUILayout.Vector3Field("Wave Length", myTarget.skySettings.waveLength);
                    EditorGUILayout.PropertyField(rayleigh, true, null);
                    EditorGUILayout.PropertyField(g, true, null);
                    EditorGUILayout.PropertyField(mie, true, null);
                    EditorGUILayout.PropertyField(scatteringCurve, true, null);
                    EditorGUILayout.PropertyField(scatteringColor, true, null);
                    EditorGUILayout.PropertyField(sunMoonPos, true, null);
                    EditorGUILayout.PropertyField(sunIntensity, true, null);
                    EditorGUILayout.PropertyField(sunDiskScale, true, null);
                    EditorGUILayout.PropertyField(sunDiskIntensity, true, null);
                    EditorGUILayout.PropertyField(sunDiskColor, true, null);
                    EditorGUILayout.PropertyField(moonPhaseMode, true, null);
                    EditorGUILayout.PropertyField(moonTexture, true, null);
                    EditorGUILayout.PropertyField(moonBrightness, true, null);
                    EditorGUILayout.PropertyField(moonGlow, true, null);
                    if (myTarget.skySettings.moonPhaseMode == EnviroSkySettings.MoonPhases.Custom)
                    {
                        EditorGUILayout.PropertyField(startMoonPhase, true, null);
                        EditorGUILayout.PropertyField(currentMoonPhase, true, null);
                    }
                    EditorGUILayout.PropertyField(skyLuminance, true, null);
                    EditorGUILayout.PropertyField(skyColorPower, true, null);
                    EditorGUILayout.PropertyField(skyExposure, true, null);
                    EditorGUILayout.PropertyField(starsCubemap, true, null);
                    EditorGUILayout.PropertyField(starsIntensity, true, null);
                    ApplyChanges();
                    break;

                // CLouds Category
                case EnviroProfile.settingsMode.Clouds:
                    GUILayout.BeginVertical(" Layer Setup", boxStyle);
                    GUILayout.Space(20);
                    if (GUILayout.Button("Add Layer"))
                    {
                        myTarget.cloudsSettings.cloudsLayers.Add(new EnviroCloudsLayerVariables());
                        myTarget.showCloudLayer.Add(true);
                    }

                    if (GUILayout.Button("Apply Changes"))
                    {
                        myTarget.InitClouds();
                    }
                    for (int i = 0; i < myTarget.cloudsSettings.cloudsLayers.Count; i++)
                    {
                        GUILayout.BeginVertical("", boxStyle);
                        myTarget.showCloudLayer [i] = EditorGUILayout.BeginToggleGroup(myTarget.cloudsSettings.cloudsLayers [i].Name, myTarget.showCloudLayer [i]);
                        if (myTarget.showCloudLayer [i])
                        {
                            GUILayout.Space(10);
                            myTarget.cloudsSettings.cloudsLayers [i].Name = EditorGUILayout.TextField("Layer Name", myTarget.cloudsSettings.cloudsLayers [i].Name);
                            GUILayout.Space(10);
                            myTarget.cloudsSettings.cloudsLayers [i].Quality         = EditorGUILayout.IntSlider("Quality", myTarget.cloudsSettings.cloudsLayers [i].Quality, 5, 100);
                            myTarget.cloudsSettings.cloudsLayers [i].segmentCount    = EditorGUILayout.IntSlider("Segments", myTarget.cloudsSettings.cloudsLayers [i].segmentCount, 4, 16);
                            myTarget.cloudsSettings.cloudsLayers [i].thickness       = EditorGUILayout.Slider("Thickness", myTarget.cloudsSettings.cloudsLayers [i].thickness, 0.001f, 0.1f);
                            myTarget.cloudsSettings.cloudsLayers [i].curved          = EditorGUILayout.Toggle("Curved", myTarget.cloudsSettings.cloudsLayers [i].curved);
                            myTarget.cloudsSettings.cloudsLayers [i].curvedIntensity = EditorGUILayout.Slider("Curved Intensity", myTarget.cloudsSettings.cloudsLayers [i].curvedIntensity, 0.001f, 0.5f);
                            myTarget.cloudsSettings.cloudsLayers [i].Scaling         = EditorGUILayout.Slider("Scaling", myTarget.cloudsSettings.cloudsLayers [i].Scaling, 0.5f, 2f);
                            GUILayout.Space(10);
                            myTarget.cloudsSettings.cloudsLayers [i].myCloudsTexture = (Texture)EditorGUILayout.ObjectField("Texture", myTarget.cloudsSettings.cloudsLayers [i].myCloudsTexture, typeof(Texture), true);
                            myTarget.cloudsSettings.cloudsLayers [i].canCastShadows  = EditorGUILayout.Toggle("Cast Shadows", myTarget.cloudsSettings.cloudsLayers [i].canCastShadows);
                            GUILayout.Space(10);
                            myTarget.cloudsSettings.cloudsLayers [i].layerAltitude = EditorGUILayout.FloatField("Layer Altitude", myTarget.cloudsSettings.cloudsLayers [i].layerAltitude);
                            myTarget.cloudsSettings.cloudsLayers [i].LayerOffset   = EditorGUILayout.FloatField("Layer Offset", myTarget.cloudsSettings.cloudsLayers [i].LayerOffset);
                            if (GUILayout.Button("Remove"))
                            {
                                myTarget.cloudsSettings.cloudsLayers.Remove(myTarget.cloudsSettings.cloudsLayers [i]);
                                if (myTarget.cloudsLayers.Count > i)
                                {
                                    myTarget.cloudsLayers.RemoveAt(i);
                                }

                                myTarget.showCloudLayer.RemoveAt(i);
                            }
                        }
                        EditorGUILayout.EndToggleGroup();
                        GUILayout.EndVertical();
                    }
                    serializedObj.Update();
                    GUILayout.EndVertical();
                    GUILayout.Space(10);
                    GUILayout.BeginVertical("Clouds Wind Animation", headerStyle);
                    GUILayout.Space(15);
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(useWindZoneDirection, true, null);
                    EditorGUILayout.PropertyField(windTimeScale, true, null);
                    EditorGUILayout.PropertyField(windIntensity, true, null);
                    if (useWindZoneDirection.boolValue == false)
                    {
                        EditorGUILayout.PropertyField(windDirectionX, true, null);
                        EditorGUILayout.PropertyField(windDirectionY, true, null);
                    }
                    GUILayout.EndVertical();


                    EditorGUILayout.PropertyField(worldScale, true, null);
                    EditorGUILayout.PropertyField(fixedAltitude, true, null);
                    EditorGUILayout.PropertyField(cloudsAltitude, true, null);
                    EditorGUILayout.PropertyField(cloudsRenderQuality, true, null);
                    EditorGUILayout.PropertyField(skyColor, true, null);
                    EditorGUILayout.PropertyField(sunHighlightColor, true, null);
                    EditorGUILayout.PropertyField(moonHighlightColor, true, null);
                    EditorGUILayout.PropertyField(lightIntensity, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsMode.Weather:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(useTag, true, null);
                    EditorGUILayout.PropertyField(wetnessAccumulationSpeed, true, null);
                    EditorGUILayout.PropertyField(wetnessDryingSpeed, true, null);
                    EditorGUILayout.PropertyField(snowAccumulationSpeed, true, null);
                    EditorGUILayout.PropertyField(snowMeltingSpeed, true, null);
                    GUILayout.Space(10);
                    EditorGUILayout.PropertyField(cloudTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(fogTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(effectTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(audioTransitionSpeed, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsMode.Season:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(daysInSpring, true, null);
                    EditorGUILayout.PropertyField(daysInSummer, true, null);
                    EditorGUILayout.PropertyField(daysInAutumn, true, null);
                    EditorGUILayout.PropertyField(daysInWinter, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsMode.Fog:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(fogmode, true, null);
                    EditorGUILayout.PropertyField(distanceFog, true, null);
                    EditorGUILayout.PropertyField(useRadialFog, true, null);
                    EditorGUILayout.PropertyField(startDistance, true, null);
                    EditorGUILayout.PropertyField(distanceFogIntensity, true, null);
                    EditorGUILayout.PropertyField(maximumFogIntensity, true, null);
                    EditorGUILayout.PropertyField(heightFog, true, null);
                    EditorGUILayout.PropertyField(height, true, null);
                    EditorGUILayout.PropertyField(heightFogIntensity, true, null);
                    EditorGUILayout.PropertyField(noiseIntensity, true, null);
                    EditorGUILayout.PropertyField(noiseScale, true, null);
                    myTarget.fogSettings.heightFogVelocity = EditorGUILayout.Vector2Field("Height Fog Velocity", myTarget.fogSettings.heightFogVelocity);
                    EditorGUILayout.PropertyField(fogDitheringScale, true, null);
                    EditorGUILayout.PropertyField(fogDitheringIntensity, true, null);
                    ApplyChanges();
                    break;



                case EnviroProfile.settingsMode.Lightshafts:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(resolution, true, null);
                    EditorGUILayout.PropertyField(screenBlendMode, true, null);
                    EditorGUILayout.PropertyField(useDepthTexture, true, null);
                    EditorGUILayout.PropertyField(lightShaftsColorSun, true, null);
                    EditorGUILayout.PropertyField(lightShaftsColorMoon, true, null);
                    EditorGUILayout.PropertyField(treshholdColorSun, true, null);
                    EditorGUILayout.PropertyField(treshholdColorMoon, true, null);
                    EditorGUILayout.PropertyField(blurRadius, true, null);
                    EditorGUILayout.PropertyField(shaftsIntensity, true, null);
                    EditorGUILayout.PropertyField(maxRadius, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsMode.Audio:
                    myTarget.Audio.SFXHolderPrefab = (GameObject)EditorGUILayout.ObjectField("SFX Prefab:", myTarget.Audio.SFXHolderPrefab, typeof(GameObject), false);
                    serializedObject.Update();
                    thunderSFX.DoLayoutList();
                    serializedObject.ApplyModifiedProperties();
                    break;

                case EnviroProfile.settingsMode.Satellites:
                    GUILayout.BeginVertical(" Layer Setup", boxStyle);
                    GUILayout.Space(20);
                    if (GUILayout.Button("Add Satellite"))
                    {
                        myTarget.satelliteSettings.additionalSatellites.Add(new EnviroSatellite());
                    }

                    if (GUILayout.Button("Apply Changes"))
                    {
                        myTarget.CheckSatellites();
                    }
                    for (int i = 0; i < myTarget.satelliteSettings.additionalSatellites.Count; i++)
                    {
                        GUILayout.BeginVertical("", boxStyle);
                        GUILayout.Space(10);
                        myTarget.satelliteSettings.additionalSatellites [i].name = EditorGUILayout.TextField("Name", myTarget.satelliteSettings.additionalSatellites [i].name);
                        GUILayout.Space(10);
                        myTarget.satelliteSettings.additionalSatellites [i].prefab = (GameObject)EditorGUILayout.ObjectField("Prefab", myTarget.satelliteSettings.additionalSatellites [i].prefab, typeof(GameObject), false);
                        myTarget.satelliteSettings.additionalSatellites [i].orbit  = EditorGUILayout.Slider("OrbitDistance", myTarget.satelliteSettings.additionalSatellites [i].orbit, 0f, myTarget.transform.localScale.y);
                        myTarget.satelliteSettings.additionalSatellites [i].xRot   = EditorGUILayout.Slider("XRot", myTarget.satelliteSettings.additionalSatellites [i].xRot, 0f, 360f);
                        myTarget.satelliteSettings.additionalSatellites [i].yRot   = EditorGUILayout.Slider("YRot", myTarget.satelliteSettings.additionalSatellites [i].yRot, 0f, 360f);
                        if (GUILayout.Button("Remove"))
                        {
                            myTarget.satelliteSettings.additionalSatellites.Remove(myTarget.satelliteSettings.additionalSatellites [i]);
                            myTarget.CheckSatellites();
                        }
                        GUILayout.EndVertical();
                    }
                    serializedObj.Update();
                    GUILayout.EndVertical();
                    break;

                case EnviroProfile.settingsMode.Background:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(enableBGRendering, true, null);
                    bgRenderingLayer.intValue = EditorGUILayout.LayerField("Background Layer", bgRenderingLayer.intValue);
                    EditorGUILayout.PropertyField(bgRenderingDistance, true, null);
                    if (EditorGUI.EndChangeCheck())
                    {
                        myTarget.ReInit();
                        serializedObj.ApplyModifiedProperties();
                        myTarget.profile.modified = true;
                    }
                    break;

                case EnviroProfile.settingsMode.Quality:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(effectQuality, true, null);
                    EditorGUILayout.PropertyField(updateInterval, true, null);
                    ApplyChanges();
                    break;
                }
            }
            GUILayout.EndVertical();
            EditorGUILayout.EndToggleGroup();
        }
        GUILayout.EndVertical();

        if (myTarget.profile != null)
        {
            EditorGUI.BeginChangeCheck();
            // Begin Setup
            GUILayout.BeginVertical("", boxStyle);
            // Player Setup
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showPlayerSetup = EditorGUILayout.BeginToggleGroup("Player & Camera Setup", myTarget.profile.showPlayerSetup);
            if (myTarget.profile.showPlayerSetup)
            {
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(Player, true, null);
                EditorGUILayout.PropertyField(Camera, true, null);
                GUILayout.Space(20);
                AssignOnRuntime.boolValue = EditorGUILayout.BeginToggleGroup("Assign On Runtime", AssignOnRuntime.boolValue);
                PlayerTag.stringValue     = EditorGUILayout.TagField("Player Tag", PlayerTag.stringValue);
                CameraTag.stringValue     = EditorGUILayout.TagField("Camera Tag", CameraTag.stringValue);
                EditorGUILayout.EndToggleGroup();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();

            /// Render Setup
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showRenderingSetup = EditorGUILayout.BeginToggleGroup("Rendering Setup", myTarget.profile.showRenderingSetup);
            if (myTarget.profile.showRenderingSetup)
            {
                EditorGUILayout.PropertyField(HDR, true, null);
                EditorGUILayout.PropertyField(setCameraClearFlags, true, null);
                GUILayout.Space(10);
                EditorGUILayout.LabelField("Layer Setup", headerStyle, null);
                SatTag.intValue = EditorGUILayout.LayerField("Sky Layer", SatTag.intValue);
                SkyTag.intValue = EditorGUILayout.LayerField("Satellite Layer", SkyTag.intValue);
                EditorGUILayout.PropertyField(singlePassVR, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();

            /// Components Setup
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showComponentsSetup = EditorGUILayout.BeginToggleGroup("Component Setup", myTarget.profile.showComponentsSetup);
            if (myTarget.profile.showComponentsSetup)
            {
                EditorGUILayout.PropertyField(Sun, true, null);
                EditorGUILayout.PropertyField(Moon, true, null);
                EditorGUILayout.PropertyField(Clouds, true, null);
                EditorGUILayout.PropertyField(DirectLight, true, null);
                EditorGUILayout.PropertyField(LightningGenerator, true, null);
                EditorGUILayout.PropertyField(windZone, true, null);
                EditorGUILayout.PropertyField(GlobalReflectionProbe, true, null);
                EditorGUILayout.PropertyField(satellites, true, null);
                EditorGUILayout.PropertyField(starsRotation, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            GUILayout.EndVertical();



            ////////////
            // Begin Controls
            GUILayout.BeginVertical("", boxStyle);
            // Time Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showTimeUI = EditorGUILayout.BeginToggleGroup("Time and Location Controls", myTarget.profile.showTimeUI);
            if (myTarget.profile.showTimeUI)
            {
                GUILayout.Space(20);
                GUILayout.BeginVertical("Time", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(ProgressMode, true, null);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(Seconds, true, null);
                EditorGUILayout.PropertyField(Minutes, true, null);
                EditorGUILayout.PropertyField(Hours, true, null);
                EditorGUILayout.PropertyField(Days, true, null);
                EditorGUILayout.PropertyField(Years, true, null);
                GUILayout.Space(10);
                EditorGUILayout.PropertyField(DayLength, true, null);
                EditorGUILayout.PropertyField(NightLength, true, null);
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Season", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(UpdateSeason, true, null);
                EditorGUILayout.PropertyField(CurrentSeason, true, null);
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Location", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(UTC, true, null);
                GUILayout.Space(10);
                EditorGUILayout.PropertyField(Latitude, true, null);
                EditorGUILayout.PropertyField(Longitude, true, null);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Time End
            // Weather Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showWeatherUI = EditorGUILayout.BeginToggleGroup("Weather Controls", myTarget.profile.showWeatherUI);
            if (myTarget.profile.showWeatherUI)
            {
                EditorGUILayout.PropertyField(UpdateWeather, true, null);
                GUILayout.BeginVertical("Weather", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(StartWeather, true, null);
                GUILayout.Space(15);
                if (Application.isPlaying)
                {
                    if (myTarget.Weather.weatherPresets.Count > 0)
                    {
                        GUIContent[] zonePrefabs = new GUIContent[myTarget.Weather.weatherPresets.Count];
                        for (int idx = 0; idx < zonePrefabs.Length; idx++)
                        {
                            zonePrefabs [idx] = new GUIContent(myTarget.Weather.weatherPresets [idx].Name);
                        }
                        int weatherID = EditorGUILayout.Popup(new GUIContent("Current Weather"), myTarget.GetActiveWeatherID(), zonePrefabs);
                        myTarget.ChangeWeather(weatherID);
                    }
                }
                else
                {
                    EditorGUILayout.LabelField("Weather can only be changed in runtime!");
                }

                if (GUILayout.Button("Edit current Weather Preset"))
                {
                    if (myTarget.Weather.currentActiveWeatherPreset != null)
                    {
                        Selection.activeObject = myTarget.Weather.currentActiveWeatherPreset;
                    }
                    else if (myTarget.Weather.startWeatherPreset != null)
                    {
                        Selection.activeObject = myTarget.Weather.startWeatherPreset;
                    }
                }
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Zones", boxStyle);
                GUILayout.Space(20);
                myTarget.Weather.currentActiveZone = (EnviroZone)EditorGUILayout.ObjectField("Current Zone", myTarget.Weather.currentActiveZone, typeof(EnviroZone), true);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Weather End
            // Effects Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showEffectsUI = EditorGUILayout.BeginToggleGroup("Feature Controls", myTarget.profile.showEffectsUI);
            if (myTarget.profile.showEffectsUI)
            {
                EditorGUILayout.PropertyField(EnableFog, true, null);
                EditorGUILayout.PropertyField(renderClouds, true, null);
                EditorGUILayout.PropertyField(EnableSunShafts, true, null);
                EditorGUILayout.PropertyField(EnableMoonShafts, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Effects End
            // Audio Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showAudioUI = EditorGUILayout.BeginToggleGroup("Audio Controls", myTarget.profile.showAudioUI);
            if (myTarget.profile.showAudioUI)
            {
                GUILayout.BeginVertical("", boxStyle);
                EditorGUILayout.PropertyField(AmbientVolume, true, null);
                EditorGUILayout.PropertyField(WeatherVolume, true, null);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Audio End
            /////////////
            if (EditorGUI.EndChangeCheck())
            {
                serializedObj.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
        else
        {
            GUILayout.BeginVertical("", boxStyle);
            EditorGUILayout.LabelField("No profile assigned!");
            if (GUILayout.Button("Create and assign new profile!"))
            {
                myTarget.profile = EnviroProfileCreation.CreateNewEnviroProfile();
                myTarget.ApplyProfile(myTarget.profile);
                myTarget.ReInit();
            }
            GUILayout.EndVertical();
        }
        EditorUtility.SetDirty(target);
    }
Beispiel #2
0
 public static bool UpdateProfile(EnviroProfile profile, string fromV, string toV)
 {
     if (Object.op_Equality((Object)profile, (Object)null))
     {
         return(false);
     }
     if ((fromV == "1.9.0" || fromV == "1.9.1") && toV == "2.0.5")
     {
         profile.lightSettings.directLightSunIntensity = new AnimationCurve();
         profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.0f));
         profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.42f));
         profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.75f, 0.5f, 5f, 5f));
         profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(1.5f, 1f));
         profile.lightSettings.directLightMoonIntensity = new AnimationCurve();
         profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.01f, 0.0f));
         profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.01f, 0.42f));
         profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.6f, 0.5f, 2f, 2f));
         profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 1f));
         profile.lightSettings.shadowIntensity = new AnimationCurve();
         profile.lightSettings.shadowIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 0.0f));
         profile.lightSettings.shadowIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 1f));
         profile.cloudsSettings.directLightIntensity = new AnimationCurve();
         profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.02f, 0.0f));
         profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.15f, 0.495f));
         profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.15f, 1f));
         profile.cloudsSettings.ambientLightIntensity = new AnimationCurve();
         profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.017f, 0.0f));
         profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.46f));
         profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.35f, 0.617f));
         profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.32f, 1f));
         profile.skySettings.moonColor     = EnviroProfileCreation.GetColor("#9C9D9EFF");
         profile.skySettings.moonGlowColor = EnviroProfileCreation.GetColor("#4D4D4DFF");
         List <Color> clrs1  = new List <Color>();
         List <float> times1 = new List <float>();
         clrs1.Add(EnviroProfileCreation.GetColor("#17171A"));
         times1.Add(0.0f);
         clrs1.Add(EnviroProfileCreation.GetColor("#17171A"));
         times1.Add(0.455f);
         clrs1.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
         times1.Add(0.48f);
         clrs1.Add(EnviroProfileCreation.GetColor("#EEB279"));
         times1.Add(0.53f);
         clrs1.Add(EnviroProfileCreation.GetColor("#EEF0FF"));
         times1.Add(0.6f);
         clrs1.Add(EnviroProfileCreation.GetColor("#ECEEFF"));
         times1.Add(1f);
         profile.cloudsSettings.cirrusCloudsColor = EnviroProfileCreation.CreateGradient(clrs1, times1);
         List <Color> clrs2  = new List <Color>();
         List <float> times2 = new List <float>();
         clrs2.Add(EnviroProfileCreation.GetColor("#17171A"));
         times2.Add(0.0f);
         clrs2.Add(EnviroProfileCreation.GetColor("#17171A"));
         times2.Add(0.455f);
         clrs2.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
         times2.Add(0.48f);
         clrs2.Add(EnviroProfileCreation.GetColor("#EEB279"));
         times2.Add(0.53f);
         clrs2.Add(EnviroProfileCreation.GetColor("#EEF0FF"));
         times2.Add(0.6f);
         clrs2.Add(EnviroProfileCreation.GetColor("#ECEEFF"));
         times2.Add(1f);
         profile.cloudsSettings.flatCloudsColor = EnviroProfileCreation.CreateGradient(clrs2, times2);
         List <Color> clrs3  = new List <Color>();
         List <float> times3 = new List <float>();
         clrs3.Add(EnviroProfileCreation.GetColor("#17171A"));
         times3.Add(0.0f);
         clrs3.Add(EnviroProfileCreation.GetColor("#17171A"));
         times3.Add(0.455f);
         clrs3.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
         times3.Add(0.48f);
         clrs3.Add(EnviroProfileCreation.GetColor("#EEB279"));
         times3.Add(0.53f);
         clrs3.Add(EnviroProfileCreation.GetColor("#CECECE"));
         times3.Add(0.58f);
         clrs3.Add(EnviroProfileCreation.GetColor("#CECECE"));
         times3.Add(1f);
         profile.cloudsSettings.volumeCloudsColor     = EnviroProfileCreation.CreateGradient(clrs3, times3);
         profile.cloudsSettings.volumeCloudsMoonColor = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#232228"), 0.0f, EnviroProfileCreation.GetColor("#B6BCDC"), 1f);
         Texture assetTexture1 = EnviroProfileCreation.GetAssetTexture("tex_enviro_noise");
         Texture assetTexture2 = EnviroProfileCreation.GetAssetTexture("tex_enviro_cirrus");
         if (Object.op_Equality((Object)assetTexture1, (Object)null) || Object.op_Equality((Object)assetTexture2, (Object)null))
         {
             Debug.Log((object)"Cannot find cloud textures");
         }
         profile.cloudsSettings.flatCloudsNoiseTexture = assetTexture1;
         profile.cloudsSettings.cirrusCloudsTexture    = assetTexture2;
         profile.skySettings.moonTexture     = EnviroProfileCreation.GetAssetTexture("tex_enviro_moon");
         profile.skySettings.moonBrightness  = 1f;
         profile.skySettings.galaxyIntensity = new AnimationCurve();
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.4f, 0.0f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.015f, 0.5f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.6f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 1f));
         profile.skySettings.galaxyCubeMap       = EnviroProfileCreation.GetAssetCubemap("cube_enviro_galaxy");
         profile.weatherSettings.lightningEffect = EnviroProfileCreation.GetAssetPrefab("Enviro_Lightning_Strike");
         profile.version = toV;
         return(true);
     }
     if ((fromV == "2.0.0" || fromV == "2.0.1" || fromV == "2.0.2") && toV == "2.0.5")
     {
         profile.skySettings.galaxyIntensity = new AnimationCurve();
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.4f, 0.0f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.015f, 0.5f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.6f));
         profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 1f));
         profile.skySettings.galaxyCubeMap       = EnviroProfileCreation.GetAssetCubemap("cube_enviro_galaxy");
         profile.weatherSettings.lightningEffect = EnviroProfileCreation.GetAssetPrefab("Enviro_Lightning_Strike");
         profile.version = toV;
         return(true);
     }
     if (fromV == "2.0.3" && toV == "2.0.5")
     {
         profile.weatherSettings.lightningEffect = EnviroProfileCreation.GetAssetPrefab("Enviro_Lightning_Strike");
         profile.version = toV;
         return(true);
     }
     if (!(fromV == "2.0.4") || !(toV == "2.0.5"))
     {
         return(false);
     }
     profile.version = toV;
     return(true);
 }
Beispiel #3
0
    public override void OnInspectorGUI()
    {
        myTarget = (EnviroSkyLite)target;
        //int daysInyear = (int)(myTarget.seasonsSettings.SpringInDays + myTarget.seasonsSettings.SummerInDays + myTarget.seasonsSettings.AutumnInDays + myTarget.seasonsSettings.WinterInDays);
        //Set up the box style
        if (boxStyle == null)
        {
            boxStyle = new GUIStyle(GUI.skin.box);
            boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
            boxStyle.fontStyle        = FontStyle.Bold;
            boxStyle.alignment        = TextAnchor.UpperLeft;
        }

        if (boxStyleModified == null)
        {
            boxStyleModified = new GUIStyle(GUI.skin.box);
            boxStyleModified.normal.textColor = GUI.skin.label.normal.textColor;
            boxStyleModified.fontStyle        = FontStyle.Bold;
            boxStyleModified.alignment        = TextAnchor.UpperLeft;
        }

        //Setup the wrap style
        if (wrapStyle == null)
        {
            wrapStyle           = new GUIStyle(GUI.skin.label);
            wrapStyle.fontStyle = FontStyle.Bold;
            wrapStyle.wordWrap  = true;
        }

        if (headerStyle == null)
        {
            headerStyle           = new GUIStyle(GUI.skin.label);
            headerStyle.fontStyle = FontStyle.Bold;
            headerStyle.alignment = TextAnchor.UpperLeft;
        }

        GUILayout.BeginVertical("EnviroSky - Lite " + latestVersion, boxStyle);
        GUILayout.Space(20);
        GUILayout.BeginVertical("Profile", boxStyle);
        GUILayout.Space(20);
        myTarget.profile = (EnviroProfile)EditorGUILayout.ObjectField(myTarget.profile, typeof(EnviroProfile), false);
        GUILayout.Space(10);
        if (myTarget.profile != null)
        {
            EditorGUILayout.LabelField("Profile Version:", myTarget.profile.version);
        }
        else
        {
            EditorGUILayout.LabelField("No Profile Assigned!");
        }
        EditorGUILayout.LabelField("Prefab Version:", myTarget.prefabVersion);
        GUILayout.Space(10);

        if (myTarget.profile != null && myTarget.profile.version != latestVersion)
        {
            if (GUILayout.Button("Update Profile"))
            {
                if (EnviroProfileCreation.UpdateProfile(myTarget.profile, myTarget.profile.version, latestVersion) == true)
                {
                    myTarget.ApplyProfile(myTarget.profile);
                }
            }
        }
        // Runtime Settings
        if (GUILayout.Button("Apply all Settings"))
        {
            myTarget.enabled = false;
            myTarget.enabled = true;
        }
        GUILayout.EndHorizontal();
        if (myTarget.profile != null)
        {
            if (myTarget.profile.modified)             // Change color when modified
            {
                GUI.backgroundColor = modifiedColor;
            }
            GUILayout.BeginVertical("", boxStyle);
            if (myTarget.profile.modified)
            {
                GUI.backgroundColor = Color.white;
            }
                        #if UNITY_5_6_OR_NEWER
            serializedObj.UpdateIfRequiredOrScript();
                        #else
            serializedObj.UpdateIfDirtyOrScript();
                        #endif
            myTarget.showSettings = EditorGUILayout.BeginToggleGroup(" Edit Profile", myTarget.showSettings);
            if (myTarget.showSettings)
            {
                GUILayout.BeginVertical("", boxStyle);
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Save to Profile"))
                {
                    myTarget.SaveProfile();
                    myTarget.profile.modified = false;
                }
                if (GUILayout.Button("Load from Profile"))
                {
                    myTarget.ApplyProfile(myTarget.profile);
                    myTarget.profile.modified = false;
                                        #if UNITY_5_6_OR_NEWER
                    serializedObj.UpdateIfRequiredOrScript();
                                        #else
                    serializedObj.UpdateIfDirtyOrScript();
                                        #endif
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(10);
                EditorGUILayout.LabelField("Category", headerStyle);
                myTarget.profile.viewModeLW = (EnviroProfile.settingsModeLW)EditorGUILayout.EnumPopup(myTarget.profile.viewModeLW);
                GUILayout.EndVertical();

                switch (myTarget.profile.viewModeLW)
                {
                case EnviroProfile.settingsModeLW.Lighting:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(directionalLightMode, true, null);
                    EditorGUILayout.PropertyField(lightColorGradient, true, null);
                    EditorGUILayout.PropertyField(lightIntensityCurveSun, true, null);
                    EditorGUILayout.PropertyField(lightIntensityCurveMoon, true, null);
                    EditorGUILayout.PropertyField(lightIntensityTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(shadowStrength, true, null);
                    EditorGUILayout.PropertyField(angleOffset, true, null);
                    EditorGUILayout.PropertyField(stopRotationAtHigh, true, null);
                    if (myTarget.lightSettings.stopRotationAtHigh)
                    {
                        EditorGUILayout.PropertyField(rotationStopHigh, true, null);
                    }
                    EditorGUILayout.PropertyField(ambientMode, true, null);
                    EditorGUILayout.PropertyField(ambientIntensityCurve, true, null);
                    EditorGUILayout.PropertyField(ambientSkyGradient, true, null);
                    EditorGUILayout.PropertyField(ambientEquatorGradient, true, null);
                    EditorGUILayout.PropertyField(ambientGroundGradient, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Sky:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(skyboxMode, true, null);
                    if (myTarget.skySettings.skyboxModeLW == EnviroSkySettings.SkyboxModiLW.CustomSkybox)
                    {
                        EditorGUILayout.PropertyField(customSkyboxMaterial, true, null);
                    }
                    if (myTarget.skySettings.skyboxModeLW == EnviroSkySettings.SkyboxModiLW.CustomColor)
                    {
                        EditorGUILayout.PropertyField(customSkyboxColor, true, null);
                    }
                    GUILayout.Space(10);
                    if (myTarget.skySettings.skyboxModeLW == EnviroSkySettings.SkyboxModiLW.Simple)
                    {
                        EditorGUILayout.LabelField("Color", headerStyle);
                        EditorGUILayout.PropertyField(simpleSkyColor, true, null);
                        EditorGUILayout.PropertyField(simpleHorizonColor, true, null);
                        EditorGUILayout.PropertyField(simpleSunColor, true, null);
                    }

                    EditorGUILayout.PropertyField(sunMoonPos, true, null);
                    if (myTarget.skySettings.skyboxModeLW == EnviroSkySettings.SkyboxModiLW.Simple)
                    {
                        EditorGUILayout.PropertyField(sunDiskSizeSimple, true, null);
                    }

                    EditorGUILayout.PropertyField(renderMoon, true, null);
                    EditorGUILayout.PropertyField(moonPhaseMode, true, null);
                    EditorGUILayout.PropertyField(moonTexture, true, null);
                    EditorGUILayout.PropertyField(moonColor, true, null);
                    if (myTarget.skySettings.moonPhaseMode == EnviroSkySettings.MoonPhases.Custom)
                    {
                        EditorGUILayout.PropertyField(startMoonPhase, true, null);
                        EditorGUILayout.PropertyField(currentMoonPhase, true, null);
                    }
                    EditorGUILayout.PropertyField(starsCubemap, true, null);
                    EditorGUILayout.PropertyField(starsIntensity, true, null);
                    //EditorGUILayout.PropertyField(galaxyCubeMap, true, null);
                    //EditorGUILayout.PropertyField(galaxyIntensity, true, null);
                    ApplyChanges();
                    break;

                // CLouds Category
                case EnviroProfile.settingsModeLW.Clouds:
                    EditorGUI.BeginChangeCheck();


                    GUILayout.BeginVertical("Particle Clouds", boxStyle);
                    GUILayout.Space(20);

                    GUILayout.BeginVertical("", boxStyle);
                    EditorGUILayout.PropertyField(particleCloudsHeight1, true, null);
                    EditorGUILayout.PropertyField(particleCloudsColor1, true, null);
                    GUILayout.Space(20);
                    EditorGUILayout.PropertyField(particleCloudsHeight2, true, null);
                    EditorGUILayout.PropertyField(particleCloudsColor2, true, null);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndVertical();

                    GUILayout.BeginVertical("Cirrus Clouds", boxStyle);
                    GUILayout.Space(20);
                    EditorGUILayout.PropertyField(cirrusCloudsTexture, true, null);
                    EditorGUILayout.PropertyField(cirrusCloudsColor, true, null);
                    EditorGUILayout.PropertyField(cirrusCloudsAltitude, true, null);

                    EditorGUILayout.EndVertical();
                    GUILayout.BeginVertical("", boxStyle);

                    EditorGUILayout.PropertyField(useWindZoneDirection, true, null);
                    EditorGUILayout.PropertyField(windTimeScale, true, null);
                    EditorGUILayout.PropertyField(windIntensity, true, null);
                    EditorGUILayout.PropertyField(cirrusWindIntensity, true, null);
                    if (useWindZoneDirection.boolValue == false)
                    {
                        EditorGUILayout.PropertyField(windDirectionX, true, null);
                        EditorGUILayout.PropertyField(windDirectionY, true, null);
                    }
                    EditorGUILayout.EndVertical();
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Weather:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(useTag, true, null);
                    EditorGUILayout.PropertyField(wetnessAccumulationSpeed, true, null);
                    EditorGUILayout.PropertyField(wetnessDryingSpeed, true, null);
                    EditorGUILayout.PropertyField(snowAccumulationSpeed, true, null);
                    EditorGUILayout.PropertyField(snowMeltingSpeed, true, null);
                    EditorGUILayout.PropertyField(snowMeltingTresholdTemperature, true, null);
                    GUILayout.Space(10);
                    EditorGUILayout.PropertyField(cloudTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(fogTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(windIntensityTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(effectTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(audioTransitionSpeed, true, null);
                    EditorGUILayout.PropertyField(lightningEffect, true, null);
                    EditorGUILayout.PropertyField(lightningRange, true, null);
                    EditorGUILayout.PropertyField(lightningHeight, true, null);
                    EditorGUILayout.PropertyField(temperatureChangingSpeed, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Reflections:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(reflectionBool, true, null);
                    if (myTarget.reflectionSettings.globalReflections)
                    {
                        GUILayout.Space(5);
                        EditorGUILayout.PropertyField(globalReflectionsUpdateOnGameTime, true, null);
                        if (myTarget.reflectionSettings.globalReflectionsUpdateOnGameTime)
                        {
                            EditorGUILayout.PropertyField(reflectionUpdate, true, null);
                        }
                        EditorGUILayout.PropertyField(globalReflectionsUpdateOnPosition, true, null);
                        GUILayout.Space(5);
                        EditorGUILayout.PropertyField(reflectionIntensity, true, null);
                        EditorGUILayout.PropertyField(globalReflectionsScale, true, null);
                        EditorGUILayout.PropertyField(globalReflectionResolution, true, null);
                        EditorGUILayout.PropertyField(globalReflectionLayers, true, null);
                    }
                    ApplyChanges();
                    break;


                case EnviroProfile.settingsModeLW.Season:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(SpringStart, true, null);
                    EditorGUILayout.PropertyField(SpringEnd, true, null);
                    EditorGUILayout.PropertyField(springBaseTemperature, true, null);

                    EditorGUILayout.PropertyField(SummerStart, true, null);
                    EditorGUILayout.PropertyField(SummerEnd, true, null);
                    EditorGUILayout.PropertyField(summerBaseTemperature, true, null);

                    EditorGUILayout.PropertyField(AutumnStart, true, null);
                    EditorGUILayout.PropertyField(AutumnEnd, true, null);
                    EditorGUILayout.PropertyField(autumnBaseTemperature, true, null);

                    EditorGUILayout.PropertyField(WinterStart, true, null);
                    EditorGUILayout.PropertyField(WinterEnd, true, null);
                    EditorGUILayout.PropertyField(winterBaseTemperature, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Fog:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(useUnityFog, true, null);
                    if (!myTarget.fogSettings.useUnityFog)
                    {
                        EditorGUILayout.PropertyField(useSimpleFog, true, null);
                    }
                    EditorGUILayout.PropertyField(fogmode, true, null);
                    if (!myTarget.fogSettings.useUnityFog)
                    {
                        EditorGUILayout.PropertyField(distanceFog, true, null);
                        EditorGUILayout.PropertyField(startDistance, true, null);
                        EditorGUILayout.PropertyField(distanceFogIntensity, true, null);
                        EditorGUILayout.PropertyField(maximumFogIntensity, true, null);
                    }
                    if (!myTarget.fogSettings.useSimpleFog && !myTarget.fogSettings.useUnityFog)
                    {
                        EditorGUILayout.PropertyField(heightFog, true, null);
                        EditorGUILayout.PropertyField(height, true, null);
                        EditorGUILayout.PropertyField(heightFogIntensity, true, null);

                        GUILayout.Space(10);
                        EditorGUILayout.LabelField("Scattering", headerStyle);
                        myTarget.skySettings.waveLength = EditorGUILayout.Vector3Field("Wave Length", myTarget.skySettings.waveLength);
                        EditorGUILayout.PropertyField(rayleigh, true, null);
                        EditorGUILayout.PropertyField(fogG, true, null);
                        EditorGUILayout.PropertyField(fogMie, true, null);
                        EditorGUILayout.PropertyField(sunIntensity, true, null);

                        EditorGUILayout.PropertyField(scatteringCurve, true, null);
                        EditorGUILayout.PropertyField(scatteringColor, true, null);
                        EditorGUILayout.PropertyField(skyLuminance, true, null);
                        EditorGUILayout.PropertyField(skyColorPower, true, null);
                        EditorGUILayout.PropertyField(skyExposure, true, null);
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(simpleFogColor, true, null);
                    }
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Lightshafts:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(resolution, true, null);
                    EditorGUILayout.PropertyField(screenBlendMode, true, null);
                    EditorGUILayout.PropertyField(useDepthTexture, true, null);
                    EditorGUILayout.PropertyField(lightShaftsColorSun, true, null);
                    EditorGUILayout.PropertyField(lightShaftsColorMoon, true, null);
                    EditorGUILayout.PropertyField(treshholdColorSun, true, null);
                    EditorGUILayout.PropertyField(treshholdColorMoon, true, null);
                    EditorGUILayout.PropertyField(blurRadius, true, null);
                    EditorGUILayout.PropertyField(shaftsIntensity, true, null);
                    EditorGUILayout.PropertyField(maxRadius, true, null);
                    ApplyChanges();
                    break;

                case EnviroProfile.settingsModeLW.Audio:
                    myTarget.Audio.SFXHolderPrefab = (GameObject)EditorGUILayout.ObjectField("SFX Prefab:", myTarget.Audio.SFXHolderPrefab, typeof(GameObject), false);
                    serializedObject.Update();
                    thunderSFX.DoLayoutList();
                    serializedObject.ApplyModifiedProperties();
                    break;

                case EnviroProfile.settingsModeLW.Satellites:
                    GUILayout.BeginVertical(" Layer Setup", boxStyle);
                    GUILayout.Space(20);
                    if (GUILayout.Button("Add Satellite"))
                    {
                        myTarget.satelliteSettings.additionalSatellites.Add(new EnviroSatellite());
                    }

                    if (GUILayout.Button("Apply Changes"))
                    {
                        myTarget.CheckSatellites();
                    }
                    for (int i = 0; i < myTarget.satelliteSettings.additionalSatellites.Count; i++)
                    {
                        GUILayout.BeginVertical("", boxStyle);
                        GUILayout.Space(10);
                        myTarget.satelliteSettings.additionalSatellites [i].name = EditorGUILayout.TextField("Name", myTarget.satelliteSettings.additionalSatellites [i].name);
                        GUILayout.Space(10);
                        myTarget.satelliteSettings.additionalSatellites [i].prefab = (GameObject)EditorGUILayout.ObjectField("Prefab", myTarget.satelliteSettings.additionalSatellites [i].prefab, typeof(GameObject), false);
                        myTarget.satelliteSettings.additionalSatellites [i].orbit  = EditorGUILayout.Slider("OrbitDistance", myTarget.satelliteSettings.additionalSatellites [i].orbit, 0f, myTarget.transform.localScale.y);
                        myTarget.satelliteSettings.additionalSatellites [i].xRot   = EditorGUILayout.Slider("XRot", myTarget.satelliteSettings.additionalSatellites [i].xRot, 0f, 360f);
                        myTarget.satelliteSettings.additionalSatellites [i].yRot   = EditorGUILayout.Slider("YRot", myTarget.satelliteSettings.additionalSatellites [i].yRot, 0f, 360f);
                        if (GUILayout.Button("Remove"))
                        {
                            myTarget.satelliteSettings.additionalSatellites.Remove(myTarget.satelliteSettings.additionalSatellites [i]);
                            myTarget.CheckSatellites();
                        }
                        GUILayout.EndVertical();
                    }
                    serializedObj.Update();
                    GUILayout.EndVertical();
                    break;

                case EnviroProfile.settingsModeLW.Quality:
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.PropertyField(effectQuality, true, null);
                    EditorGUILayout.PropertyField(updateInterval, true, null);
                    ApplyChanges();
                    break;
                }
            }
            GUILayout.EndVertical();
            EditorGUILayout.EndToggleGroup();
        }
        GUILayout.EndVertical();

        if (myTarget.profile != null)
        {
            EditorGUI.BeginChangeCheck();
            // Begin Setup
            GUILayout.BeginVertical("", boxStyle);
            // Player Setup
            if ((myTarget.Player == null || myTarget.PlayerCamera == null) && !myTarget.AssignInRuntime)
            {
                GUI.backgroundColor = modifiedColor;
            }
            else if ((myTarget.Player != null && myTarget.PlayerCamera != null) || myTarget.AssignInRuntime)
            {
                GUI.backgroundColor = greenColor;
            }

            GUILayout.BeginVertical("", boxStyle);
            GUI.backgroundColor = Color.white;
            myTarget.profile.showPlayerSetup = EditorGUILayout.BeginToggleGroup("Player & Camera Setup", myTarget.profile.showPlayerSetup);
            if (myTarget.profile.showPlayerSetup)
            {
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(Player, true, null);
                EditorGUILayout.PropertyField(Camera, true, null);
                GUILayout.Space(20);
                AssignOnRuntime.boolValue = EditorGUILayout.BeginToggleGroup("Assign On Runtime", AssignOnRuntime.boolValue);
                PlayerTag.stringValue     = EditorGUILayout.TagField("Player Tag", PlayerTag.stringValue);
                CameraTag.stringValue     = EditorGUILayout.TagField("Camera Tag", CameraTag.stringValue);
                EditorGUILayout.EndToggleGroup();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();


            /// Render Setup
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showRenderingSetup = EditorGUILayout.BeginToggleGroup("Rendering Setup", myTarget.profile.showRenderingSetup);
            if (myTarget.profile.showRenderingSetup)
            {
                EditorGUILayout.PropertyField(HDR, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();

            /// Components Setup
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showComponentsSetup = EditorGUILayout.BeginToggleGroup("Component Setup", myTarget.profile.showComponentsSetup);
            if (myTarget.profile.showComponentsSetup)
            {
                EditorGUILayout.PropertyField(Sun, true, null);
                EditorGUILayout.PropertyField(Moon, true, null);
                EditorGUILayout.PropertyField(DirectLight, true, null);
                EditorGUILayout.PropertyField(AdditionalDirectLight, true, null);
                EditorGUILayout.PropertyField(LightningGenerator, true, null);
                EditorGUILayout.PropertyField(windZone, true, null);
                EditorGUILayout.PropertyField(GlobalReflectionProbe, true, null);
                EditorGUILayout.PropertyField(satellites, true, null);
                EditorGUILayout.PropertyField(starsRotation, true, null);
                EditorGUILayout.PropertyField(particleClouds, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            GUILayout.EndVertical();



            ////////////
            // Begin Controls
            GUILayout.BeginVertical("", boxStyle);
            // Time Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showTimeUI = EditorGUILayout.BeginToggleGroup("Time and Location Controls", myTarget.profile.showTimeUI);
            if (myTarget.profile.showTimeUI)
            {
                GUILayout.Space(20);
                GUILayout.BeginVertical("Time", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(ProgressMode, true, null);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(Seconds, true, null);
                EditorGUILayout.PropertyField(Minutes, true, null);
                EditorGUILayout.PropertyField(Hours, true, null);
                EditorGUILayout.PropertyField(Days, true, null);
                EditorGUILayout.PropertyField(Years, true, null);
                GUILayout.Space(10);
                EditorGUILayout.PropertyField(DaysInYear, true, null);
                EditorGUILayout.PropertyField(DayLength, true, null);
                EditorGUILayout.PropertyField(NightLength, true, null);
                EditorGUILayout.PropertyField(dayNightSwitch, true, null);
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Season", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(UpdateSeason, true, null);
                EditorGUILayout.PropertyField(CurrentSeason, true, null);
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Location", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(UTC, true, null);
                GUILayout.Space(10);
                EditorGUILayout.PropertyField(Latitude, true, null);
                EditorGUILayout.PropertyField(Longitude, true, null);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Time End
            // Weather Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showWeatherUI = EditorGUILayout.BeginToggleGroup("Weather Controls", myTarget.profile.showWeatherUI);
            if (myTarget.profile.showWeatherUI)
            {
                EditorGUILayout.PropertyField(UpdateWeather, true, null);
                GUILayout.BeginVertical("Weather", boxStyle);
                GUILayout.Space(20);
                EditorGUILayout.PropertyField(StartWeather, true, null);
                GUILayout.Space(15);
                if (Application.isPlaying)
                {
                    if (myTarget.Weather.weatherPresets.Count > 0)
                    {
                        GUIContent[] zonePrefabs = new GUIContent[myTarget.Weather.weatherPresets.Count];
                        for (int idx = 0; idx < zonePrefabs.Length; idx++)
                        {
                            zonePrefabs [idx] = new GUIContent(myTarget.Weather.weatherPresets [idx].Name);
                        }
                        int weatherID = EditorGUILayout.Popup(new GUIContent("Current Weather"), myTarget.GetActiveWeatherID(), zonePrefabs);
                        myTarget.ChangeWeather(weatherID);
                    }
                }
                else
                {
                    EditorGUILayout.LabelField("Weather can only be changed in runtime!");
                }

                if (GUILayout.Button("Edit current Weather Preset"))
                {
                    if (myTarget.Weather.currentActiveWeatherPreset != null)
                    {
                        Selection.activeObject = myTarget.Weather.currentActiveWeatherPreset;
                    }
                    else if (myTarget.Weather.startWeatherPreset != null)
                    {
                        Selection.activeObject = myTarget.Weather.startWeatherPreset;
                    }
                }
                GUILayout.EndVertical();
                GUILayout.BeginVertical("Zones", boxStyle);
                GUILayout.Space(20);
                myTarget.Weather.currentActiveZone = (EnviroZone)EditorGUILayout.ObjectField("Current Zone", myTarget.Weather.currentActiveZone, typeof(EnviroZone), true);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Weather End
            // Effects Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showEffectsUI = EditorGUILayout.BeginToggleGroup("Feature Controls", myTarget.profile.showEffectsUI);
            if (myTarget.profile.showEffectsUI)
            {
                EditorGUILayout.PropertyField(usePostEffectFog, true, null);
                EditorGUILayout.PropertyField(renderClouds, true, null);
                EditorGUILayout.PropertyField(EnableSunShafts, true, null);
                EditorGUILayout.PropertyField(EnableMoonShafts, true, null);
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Effects End
            // Audio Control
            GUILayout.BeginVertical("", boxStyle);
            myTarget.profile.showAudioUI = EditorGUILayout.BeginToggleGroup("Audio Controls", myTarget.profile.showAudioUI);
            if (myTarget.profile.showAudioUI)
            {
                GUILayout.BeginVertical("", boxStyle);
                EditorGUILayout.PropertyField(AmbientVolume, true, null);
                EditorGUILayout.PropertyField(WeatherVolume, true, null);
                GUILayout.EndVertical();
            }
            EditorGUILayout.EndToggleGroup();
            GUILayout.EndVertical();
            // Audio End
            /////////////
            if (EditorGUI.EndChangeCheck())
            {
                serializedObj.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }
        else
        {
            GUILayout.BeginVertical("", boxStyle);
            EditorGUILayout.LabelField("No profile assigned!");
            if (GUILayout.Button("Create and assign new profile!"))
            {
                myTarget.profile = EnviroProfileCreation.CreateNewEnviroProfile();
                myTarget.ApplyProfile(myTarget.profile);
                myTarget.ReInit();
            }
            GUILayout.EndVertical();
        }
        EditorUtility.SetDirty(target);
    }
Beispiel #4
0
    public static void SetupDefaults(EnviroProfile profile)
    {
        List <Color> clrs1  = new List <Color>();
        List <float> times1 = new List <float>();

        clrs1.Add(EnviroProfileCreation.GetColor("#4C5570"));
        times1.Add(0.0f);
        clrs1.Add(EnviroProfileCreation.GetColor("#4C5570"));
        times1.Add(0.46f);
        clrs1.Add(EnviroProfileCreation.GetColor("#C98842"));
        times1.Add(0.51f);
        clrs1.Add(EnviroProfileCreation.GetColor("#EAC8A4"));
        times1.Add(0.56f);
        clrs1.Add(EnviroProfileCreation.GetColor("#EADCCE"));
        times1.Add(1f);
        profile.lightSettings.LightColor = EnviroProfileCreation.CreateGradient(clrs1, times1);
        List <Color> clrs2  = new List <Color>();
        List <float> times2 = new List <float>();

        profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.0f));
        profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.42f));
        profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(0.75f, 0.5f, 5f, 5f));
        profile.lightSettings.directLightSunIntensity.AddKey(EnviroProfileCreation.CreateKey(1.5f, 1f));
        profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.01f, 0.0f));
        profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.01f, 0.42f));
        profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(0.6f, 0.5f, 2f, 2f));
        profile.lightSettings.directLightMoonIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 1f));
        profile.lightSettings.shadowIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 0.0f));
        profile.lightSettings.shadowIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 1f));
        profile.lightSettings.ambientIntensity.AddKey(EnviroProfileCreation.CreateKey(0.75f, 0.0f));
        profile.lightSettings.ambientIntensity.AddKey(EnviroProfileCreation.CreateKey(0.75f, 1f));
        clrs2.Add(EnviroProfileCreation.GetColor("#4C5570"));
        times2.Add(0.0f);
        clrs2.Add(EnviroProfileCreation.GetColor("#4C5570"));
        times2.Add(0.46f);
        clrs2.Add(EnviroProfileCreation.GetColor("#C98842"));
        times2.Add(0.51f);
        clrs2.Add(EnviroProfileCreation.GetColor("#99B2C3"));
        times2.Add(0.57f);
        clrs2.Add(EnviroProfileCreation.GetColor("#99B2C3"));
        times2.Add(1f);
        profile.lightSettings.ambientSkyColor = EnviroProfileCreation.CreateGradient(clrs2, times2);
        List <Color> clrs3  = new List <Color>();
        List <float> times3 = new List <float>();

        profile.lightSettings.ambientEquatorColor = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#2E3344"), 0.0f, EnviroProfileCreation.GetColor("#414852"), 1f);
        profile.lightSettings.ambientGroundColor  = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#272B39"), 0.0f, EnviroProfileCreation.GetColor("#3E3631"), 1f);
        profile.skySettings.scatteringCurve.AddKey(EnviroProfileCreation.CreateKey(-25f, 0.0f));
        profile.skySettings.scatteringCurve.AddKey(EnviroProfileCreation.CreateKey(-10f, 0.5f, 55f, 55f));
        profile.skySettings.scatteringCurve.AddKey(EnviroProfileCreation.CreateKey(6.5f, 0.52f, 35f, 35f));
        profile.skySettings.scatteringCurve.AddKey(EnviroProfileCreation.CreateKey(11f, 1f));
        clrs3.Add(EnviroProfileCreation.GetColor("#8492C8"));
        times3.Add(0.0f);
        clrs3.Add(EnviroProfileCreation.GetColor("#8492C8"));
        times3.Add(0.45f);
        clrs3.Add(EnviroProfileCreation.GetColor("#FFB69C"));
        times3.Add(0.527f);
        clrs3.Add(EnviroProfileCreation.GetColor("#D2D2D2"));
        times3.Add(0.75f);
        clrs3.Add(EnviroProfileCreation.GetColor("#D2D2D2"));
        times3.Add(1f);
        profile.skySettings.scatteringColor = EnviroProfileCreation.CreateGradient(clrs3, times3);
        List <Color> clrs4  = new List <Color>();
        List <float> times4 = new List <float>();

        clrs4.Add(EnviroProfileCreation.GetColor("#0A0300"));
        times4.Add(0.0f);
        clrs4.Add(EnviroProfileCreation.GetColor("#FF6211"));
        times4.Add(0.45f);
        clrs4.Add(EnviroProfileCreation.GetColor("#FF6917"));
        times4.Add(0.55f);
        clrs4.Add(EnviroProfileCreation.GetColor("#FFE2CB"));
        times4.Add(0.75f);
        clrs4.Add(EnviroProfileCreation.GetColor("#FFFFFF"));
        times4.Add(1f);
        profile.skySettings.sunDiskColor = EnviroProfileCreation.CreateGradient(clrs4, times4);
        List <Color> clrs5  = new List <Color>();
        List <float> times5 = new List <float>();

        profile.skySettings.moonGlow.AddKey(EnviroProfileCreation.CreateKey(1f, 0.0f));
        profile.skySettings.moonGlow.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.65f));
        profile.skySettings.moonGlow.AddKey(EnviroProfileCreation.CreateKey(0.0f, 1f));
        profile.skySettings.skyLuminence.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.0f));
        profile.skySettings.skyLuminence.AddKey(EnviroProfileCreation.CreateKey(0.15f, 0.5f));
        profile.skySettings.skyLuminence.AddKey(EnviroProfileCreation.CreateKey(0.105f, 0.62f));
        profile.skySettings.skyLuminence.AddKey(EnviroProfileCreation.CreateKey(0.1f, 1f));
        profile.skySettings.skyColorPower.AddKey(EnviroProfileCreation.CreateKey(1.5f, 0.0f));
        profile.skySettings.skyColorPower.AddKey(EnviroProfileCreation.CreateKey(1.25f, 1f));
        profile.skySettings.starsIntensity.AddKey(EnviroProfileCreation.CreateKey(0.3f, 0.0f));
        profile.skySettings.starsIntensity.AddKey(EnviroProfileCreation.CreateKey(0.015f, 0.5f));
        profile.skySettings.starsIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.6f));
        profile.skySettings.starsIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 1f));
        profile.skySettings.moonTexture  = EnviroProfileCreation.GetAssetTexture("tex_enviro_moon");
        profile.skySettings.starsCubeMap = EnviroProfileCreation.GetAssetCubemap("cube_enviro_stars");
        profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(1f, 0.0f));
        profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.015f, 0.5f));
        profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.6f));
        profile.skySettings.galaxyIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 1f));
        profile.skySettings.galaxyCubeMap = EnviroProfileCreation.GetAssetCubemap("cube_enviro_galaxy");
        Texture assetTexture1 = EnviroProfileCreation.GetAssetTexture("tex_enviro_noise");
        Texture assetTexture2 = EnviroProfileCreation.GetAssetTexture("tex_enviro_cirrus");

        if (Object.op_Equality((Object)assetTexture1, (Object)null) || Object.op_Equality((Object)assetTexture2, (Object)null))
        {
            Debug.Log((object)"Cannot find cloud textures");
        }
        profile.cloudsSettings.flatCloudsNoiseTexture = assetTexture1;
        profile.cloudsSettings.cirrusCloudsTexture    = assetTexture2;
        profile.cloudsSettings.volumeCloudsMoonColor  = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#232228"), 0.0f, EnviroProfileCreation.GetColor("#B6BCDC"), 1f);
        clrs5.Add(EnviroProfileCreation.GetColor("#17171A"));
        times5.Add(0.0f);
        clrs5.Add(EnviroProfileCreation.GetColor("#17171A"));
        times5.Add(0.455f);
        clrs5.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
        times5.Add(0.48f);
        clrs5.Add(EnviroProfileCreation.GetColor("#EEB279"));
        times5.Add(0.53f);
        clrs5.Add(EnviroProfileCreation.GetColor("#EEF0FF"));
        times5.Add(0.6f);
        clrs5.Add(EnviroProfileCreation.GetColor("#ECEEFF"));
        times5.Add(1f);
        profile.cloudsSettings.cirrusCloudsColor = EnviroProfileCreation.CreateGradient(clrs5, times5);
        List <Color> clrs6  = new List <Color>();
        List <float> times6 = new List <float>();

        clrs6.Add(EnviroProfileCreation.GetColor("#17171A"));
        times6.Add(0.0f);
        clrs6.Add(EnviroProfileCreation.GetColor("#17171A"));
        times6.Add(0.455f);
        clrs6.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
        times6.Add(0.48f);
        clrs6.Add(EnviroProfileCreation.GetColor("#EEB279"));
        times6.Add(0.53f);
        clrs6.Add(EnviroProfileCreation.GetColor("#EEF0FF"));
        times6.Add(0.6f);
        clrs6.Add(EnviroProfileCreation.GetColor("#ECEEFF"));
        times6.Add(1f);
        profile.cloudsSettings.flatCloudsColor = EnviroProfileCreation.CreateGradient(clrs6, times6);
        List <Color> clrs7  = new List <Color>();
        List <float> times7 = new List <float>();

        clrs7.Add(EnviroProfileCreation.GetColor("#17171A"));
        times7.Add(0.0f);
        clrs7.Add(EnviroProfileCreation.GetColor("#17171A"));
        times7.Add(0.455f);
        clrs7.Add(EnviroProfileCreation.GetColor("#3D3D3B"));
        times7.Add(0.48f);
        clrs7.Add(EnviroProfileCreation.GetColor("#EEB279"));
        times7.Add(0.53f);
        clrs7.Add(EnviroProfileCreation.GetColor("#CECECE"));
        times7.Add(0.58f);
        clrs7.Add(EnviroProfileCreation.GetColor("#CECECE"));
        times7.Add(1f);
        profile.cloudsSettings.volumeCloudsColor = EnviroProfileCreation.CreateGradient(clrs7, times7);
        List <Color> clrs8  = new List <Color>();
        List <float> times8 = new List <float>();

        profile.cloudsSettings.directLightIntensity = new AnimationCurve();
        profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.02f, 0.0f));
        profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.15f, 0.495f));
        profile.cloudsSettings.directLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.15f, 1f));
        profile.cloudsSettings.ambientLightIntensity = new AnimationCurve();
        profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.017f, 0.0f));
        profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.0f, 0.46f));
        profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.35f, 0.617f));
        profile.cloudsSettings.ambientLightIntensity.AddKey(EnviroProfileCreation.CreateKey(0.32f, 1f));
        clrs8.Add(EnviroProfileCreation.GetColor("#FF703C"));
        times8.Add(0.0f);
        clrs8.Add(EnviroProfileCreation.GetColor("#FF5D00"));
        times8.Add(0.47f);
        clrs8.Add(EnviroProfileCreation.GetColor("#FFF4DF"));
        times8.Add(0.65f);
        clrs8.Add(EnviroProfileCreation.GetColor("#FFFFFF"));
        times8.Add(1f);
        profile.lightshaftsSettings.lightShaftsColorSun = EnviroProfileCreation.CreateGradient(clrs8, times8);
        List <Color> clrs9  = new List <Color>();
        List <float> times9 = new List <float>();

        profile.lightshaftsSettings.lightShaftsColorMoon = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#94A8E5"), 0.0f, EnviroProfileCreation.GetColor("#94A8E5"), 1f);
        clrs9.Add(EnviroProfileCreation.GetColor("#1D1D1D"));
        times9.Add(0.0f);
        clrs9.Add(EnviroProfileCreation.GetColor("#1D1D1D"));
        times9.Add(0.43f);
        clrs9.Add(EnviroProfileCreation.GetColor("#A6A6A6"));
        times9.Add(0.54f);
        clrs9.Add(EnviroProfileCreation.GetColor("#D0D0D0"));
        times9.Add(0.65f);
        clrs9.Add(EnviroProfileCreation.GetColor("#C3C3C3"));
        times9.Add(1f);
        profile.lightshaftsSettings.thresholdColorSun = EnviroProfileCreation.CreateGradient(clrs9, times9);
        List <Color> colorList = new List <Color>();
        List <float> floatList = new List <float>();

        profile.lightshaftsSettings.thresholdColorMoon = EnviroProfileCreation.CreateGradient(EnviroProfileCreation.GetColor("#0B0B0B"), 0.0f, EnviroProfileCreation.GetColor("#000000"), 1f);
        profile.weatherSettings.lightningEffect        = EnviroProfileCreation.GetAssetPrefab("Enviro_Lightning_Strike");
        for (int index = 0; index < 8; ++index)
        {
            profile.audioSettings.ThunderSFX.Add(EnviroProfileCreation.GetAudioClip("SFX_Thunder_" + (object)(index + 1)));
        }
        profile.weatherSettings.lightningEffect = EnviroProfileCreation.GetAssetPrefab("Enviro_Lightning_Strike");
    }