public override void OnInspectorGUI()
        {
            bool forceUpdateProperties = false;

#if UNITY_5_6_OR_NEWER
            serializedObject.UpdateIfRequiredOrScript();
#else
            serializedObject.UpdateIfDirtyOrScript();
#endif

            if (sectionHeaderStyle == null)
            {
                sectionHeaderStyle = new GUIStyle(EditorStyles.foldout);
            }
            sectionHeaderStyle.SetFoldoutColor();

            if (titleLabelStyle == null)
            {
                titleLabelStyle = new GUIStyle(EditorStyles.label);
            }
            titleLabelStyle.normal.textColor = titleColor;
            titleLabelStyle.fontStyle        = FontStyle.Bold;

            EditorGUILayout.Separator();

            EditorGUILayout.BeginHorizontal();
            GUILayout.Label(_headerTexture, GUILayout.ExpandWidth(true));
            if (GUILayout.Button("Help", GUILayout.Width(40)))
            {
                if (!EditorUtility.DisplayDialog("Global Snow", "To learn more about a property in this inspector move the mouse over the label for a quick description (tooltip).\n\nPlease check README file in the root of the asset for details and contact support.\n\nIf you like Global Snow, please rate it on the Asset Store. For feedback and suggestions visit our support forum on kronnect.com.", "Close", "Visit Support Forum"))
                {
                    Application.OpenURL("http://kronnect.com/taptapgo");
                }
            }
            EditorGUILayout.EndHorizontal();

            bool deferred = gs.snowCamera != null && gs.snowCamera.actualRenderingPath == RenderingPath.DeferredShading;

            expandSection[SCENE_SETTINGS] = EditorGUILayout.Foldout(expandSection[SCENE_SETTINGS], sectionNames[SCENE_SETTINGS], sectionHeaderStyle);
            if (expandSection[SCENE_SETTINGS])
            {
                EditorGUILayout.PropertyField(sun, new GUIContent("Sun", "Used to compute basic lighting over snow."));
                if (deferred)
                {
                    EditorGUILayout.PropertyField(forceForwardRenderingPath, new GUIContent("Forward Rendering", "Forces use of forward rendering path."));
                }
                bool showForwardOptions = true;
                if (deferred && !gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.PropertyField(deferredCameraEvent, new GUIContent("Deferred Camera Event", "The camera event to which the Command Buffer will be attached. Default setting is BeforeReflections. You can also try BeforeLighting (for example if you disable deferred reflections in Graphics Settings)."));
                    EditorGUILayout.PropertyField(floatingPointNormalsBuffer, new GUIContent("FP Normals Buffer", "Enables floating-point normals buffer (16 bit precision). If disabled, 8-bit precision will be used. Enable if you experiment some snow artifacts in the distance."));
                    if (updateSpeedTree.boolValue || opaqueCutout.boolValue || fixMaterials.boolValue)
                    {
                        EditorGUILayout.HelpBox("Using deferred rendering workflow.\nThe options below should be disabled.", MessageType.Warning);
                    }
                    else
                    {
                        showForwardOptions = false;
                    }
                }
                if (showForwardOptions || gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.PropertyField(updateSpeedTree, new GUIContent("Update SpeedTree", "Updates SpeedTree materials so they appear covered by snow."));
                    if (!updateSpeedTree.boolValue)
                    {
                        GUI.enabled = false;
                    }
                    EditorGUILayout.PropertyField(speedTreeRemoveLeaves, new GUIContent("   Remove Leaves", "Uses alternate SpeedTree shader that does not render leaves."));
                    GUI.enabled = true;
                    EditorGUILayout.PropertyField(opaqueCutout, new GUIContent("Opaque Cutout", "Enables alpha cutout on opaque objects. Usually all opaque objects will be covered by snow (unless they belong to an exclusion layer). Some trees or models uses opaque rendertype but they expose holes or transparent geometry. Enabling this feature will automatically cutout the opaque model based on the alpha value of the texture."));
                    EditorGUILayout.PropertyField(fixMaterials, new GUIContent("Fix Materials", "Overrides RenderType tag on those materials that don't specify one and set them to Opaque. Shaders with transparent render queue will be ignored. Use only if you experiment problems with some objects that get clipped by the snow."));
                }
                if (!deferred || gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.PropertyField(forceSPSR, new GUIContent("Force VR SPSR", "Forces compatibility with Single Pass Stereo Rendering with OpenVR. Not needed if you use Oculus SDK."));
                    EditorGUILayout.PropertyField(debugSnow, new GUIContent("Debug Mode", "Shows snow layer."));
                    EditorGUILayout.PropertyField(showSnowInSceneView, new GUIContent("Show In Scene View", "Enabled rendering of snow in the Scene View."));
                    EditorGUILayout.HelpBox("Please check the documentation or contact us (by email at [email protected] or using our support forum on kronnect.com) if you find any issue with custom shaders or objects being clipped by snow rendering.", MessageType.Info);
                }
            }

            EditorGUILayout.Separator();
            expandSection[QUALITY_SETTINGS] = EditorGUILayout.Foldout(expandSection[QUALITY_SETTINGS], sectionNames[QUALITY_SETTINGS], sectionHeaderStyle);
            if (expandSection[QUALITY_SETTINGS])
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("Preset", GUILayout.Width(120));
                if (GUILayout.Button(new GUIContent("Best Quality", "Enables relief, occlusion and better coverage quality.")))
                {
                    coverageResolution.intValue    = 3;
                    smoothCoverage.boolValue       = true;
                    snowQuality.intValue           = (int)SNOW_QUALITY.ReliefMapping;
                    reliefAmount.floatValue        = 0.3f;
                    occlusion.boolValue            = true;
                    occlusionIntensity.floatValue  = 1.2f;
                    glitterStrength.floatValue     = 0.75f;
                    distanceOptimization.boolValue = false;
                }
                if (GUILayout.Button(new GUIContent("Medium", "Enables relief and occlusion, normal coverage quality and medium distance optimization.")))
                {
                    coverageResolution.intValue    = 2;
                    smoothCoverage.boolValue       = true;
                    snowQuality.intValue           = (int)SNOW_QUALITY.ReliefMapping;
                    reliefAmount.floatValue        = 0.3f;
                    occlusion.boolValue            = true;
                    occlusionIntensity.floatValue  = 1.2f;
                    glitterStrength.floatValue     = 0.75f;
                    distanceOptimization.boolValue = true;
                    detailDistance.floatValue      = 500f;
                }
                if (!deferred && !gs.forceForwardRenderingPath)
                {
                    if (GUILayout.Button(new GUIContent("Faster", "Enables flat shading and use a faster coverage computation plus shorter distance optimization.")))
                    {
                        coverageExtension.intValue     = 1;
                        coverageResolution.intValue    = 1;
                        snowQuality.intValue           = (int)SNOW_QUALITY.FlatShading;
                        smoothCoverage.boolValue       = false;
                        distanceOptimization.boolValue = true;
                        detailDistance.floatValue      = 100f;
                    }
                }
                if (GUILayout.Button(new GUIContent("Fastest", "Uses optimized snow renderer for distance snow on entire scene.")))
                {
                    coverageExtension.intValue     = 1;
                    coverageResolution.intValue    = 1;
                    snowQuality.intValue           = (int)SNOW_QUALITY.FlatShading;
                    smoothCoverage.boolValue       = false;
                    distanceOptimization.boolValue = true;
                    detailDistance.floatValue      = 0f;
                }
                EditorGUILayout.EndHorizontal();
                if (!deferred || gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.PropertyField(distanceOptimization, new GUIContent("Distance Optimization", "Reduces snow detail beyond a given distance from the camera."));
                    if (distanceOptimization.boolValue)
                    {
                        EditorGUILayout.PropertyField(detailDistance, new GUIContent("   Detail Distance", "Beyond this limit the snow will be rendered in a simplified way, reducing GPU usage."));
                        EditorGUILayout.PropertyField(distanceIgnoreCoverage, new GUIContent("   Ignore Coverage", "Ignore coverage computation checking while rendering distant snow."));
                        EditorGUILayout.PropertyField(distanceIgnoreNormals, new GUIContent("   Ignore Normals", "Ignore surface normal on distance snow (makes distance snow rendering faster)."));
                        if (!distanceIgnoreNormals.boolValue)
                        {
                            EditorGUILayout.PropertyField(distanceSlopeThreshold, new GUIContent("   Slope Threshold", "Custom slope threshold for distance snow."));
                        }
                        EditorGUILayout.PropertyField(distanceSnowColor, new GUIContent("   Tint", "Snow color on the distance."));
                    }
                }
            }

            EditorGUILayout.Separator();
            expandSection[COVERAGE_SETTINGS] = EditorGUILayout.Foldout(expandSection[COVERAGE_SETTINGS], sectionNames[COVERAGE_SETTINGS], sectionHeaderStyle);
            if (expandSection[COVERAGE_SETTINGS])
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PropertyField(layerMask, new GUIContent("Layer Mask", "Optionally exclude some objects from being covered by snow. Alternatively you can add the script GlobalSnowIgnoreCoverage to any number of gameobjects to be exluded without changing their layer."));
                if (GUILayout.Button("Refresh", GUILayout.Width(80)))
                {
                    forceUpdateProperties = true;
                }
                EditorGUILayout.EndHorizontal();
                if (!deferred || gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.PropertyField(excludedCastShadows, new GUIContent("Excluded Cast Shadows", "If set to false, excluded objects from the layer mask won't cast shadows on snow (improves performance)."));
                }
                EditorGUILayout.PropertyField(zenithalMask, new GUIContent("Zenithal Mask", "Specify which objects are considered for top-down occlusion. Objects on top prevent snow on objects beneath them. Make sure to exclude any particle system to improve performance and avoid coverage issues."));
                EditorGUILayout.PropertyField(defaultExclusionLayer, new GUIContent("Ref Exclusion Layer", "This is the layer used to exclude temporary objects marked as not covered by snow. Use a layer number that you don't use."));
                EditorGUILayout.PropertyField(minimumAltitude, new GUIContent("Minimum Altitude", "Specify snow level."));
#if WORLDAPI_PRESENT
                if (enableWMAPI.boolValue)
                {
                    EditorGUILayout.HelpBox("Minimum altitude controlled by World Manager API.", MessageType.Info);
                }
#endif
                string t1, t2;
                if (deferred && !gs.forceForwardRenderingPath)
                {
                    EditorGUILayout.LabelField("Billboard Only Options");
                    t1 = "   Tree Coverage";
                    t2 = "   Grass Coverage";
                }
                else
                {
                    t1 = "Tree Coverage";
                    t2 = "Grass Coverage";
                }
                EditorGUILayout.PropertyField(minimumAltitudeVegetationOffset, new GUIContent("   Altitude Offset", "Applies a vertical offset to the minimum altitude only to grass and trees. This option is useful to avoid showing full grass or trees covered with snow when altitude scattered is used and there's little snow on ground which causes unnatural visuals."));
                EditorGUILayout.PropertyField(billboardCoverage, new GUIContent(t1, "Amount of snow over tree billboards."));
                EditorGUILayout.PropertyField(grassCoverage, new GUIContent(t2, "Amount of snow over grass objects."));
                EditorGUILayout.PropertyField(groundCoverage, new GUIContent("Ground Coverage", "Increase or reduce snow coverage under opaque objects."));
                EditorGUILayout.PropertyField(coverageExtension, new GUIContent("Coverage Extension", "Area included in the snow coverage. 1 = 512 meters, 2 = 1024 meters. Note that greater extension reduces quality."));
                EditorGUILayout.PropertyField(coverageResolution, new GUIContent("Coverage Quality", "Resolution of the coverage texture (1=512 pixels, 2=1024 pixels, 3=2048 pixels)."));
                EditorGUILayout.PropertyField(smoothCoverage, new GUIContent("Smooth Coverage", "Increase snow converage quality."));
                EditorGUILayout.PropertyField(coverageMask, new GUIContent("Coverage Mask", "Uses alpha channel of a custom texture as snow coverage mask."));
                if (coverageMask.boolValue)
                {
                    EditorGUILayout.PropertyField(coverageMaskTexture, new GUIContent("   Texture (A)", "Snow coverage mask. A value of alpha of zero means no snow."));
                    EditorGUILayout.PropertyField(coverageMaskWorldSize, new GUIContent("   World Size", "Mapping of the texture against the world in world units. Usually this should match terrain size."));
                    EditorGUILayout.PropertyField(coverageMaskWorldCenter, new GUIContent("   World Center", "Mapping of the texture center against the world in world units. Use this as an offset to apply coverage mask over a certain area."));
                }
                EditorGUILayout.PropertyField(coverageUpdateMethod, new GUIContent("Coverage Update", "Specifies when the snow coverage needs to be computed. Every frame, Discrete (every 50 meters of player movement), or Manual (requires manual call to UpdateSnowCoverage function)."));
                if (Application.isPlaying && GUILayout.Button("Update Coverage Now"))
                {
                    forceUpdateProperties = true;
                }
            }

            EditorGUILayout.Separator();
            expandSection[APPEARANCE_SETTINGS] = EditorGUILayout.Foldout(expandSection[APPEARANCE_SETTINGS], sectionNames[APPEARANCE_SETTINGS], sectionHeaderStyle);

            if (expandSection[APPEARANCE_SETTINGS])
            {
                if (!deferred && detailDistance.floatValue <= 0f)
                {
                    EditorGUILayout.HelpBox("Distance Optimization is enabled for the entire scene.", MessageType.Info);
                    GUI.enabled = false;
                }
                EditorGUILayout.PropertyField(snowAmount, new GUIContent("Snow Amount", "Global snow threshold."));

                EditorGUILayout.PropertyField(snowQuality, new GUIContent("Snow Complexity", "Choose the rendering scheme for the snow."));
                if (snowQuality.intValue == (int)SNOW_QUALITY.ReliefMapping)
                {
                    EditorGUILayout.PropertyField(reliefAmount, new GUIContent("   Relief Amount", "Relief intensity."));
                    EditorGUILayout.PropertyField(occlusion, new GUIContent("   Occlusion", "Enables occlusion effect."));
                    if (occlusion.boolValue)
                    {
                        EditorGUILayout.PropertyField(occlusionIntensity, new GUIContent("      Intensity", "Occlusion intensity."));
                    }
                }
                if (snowQuality.intValue != (int)SNOW_QUALITY.FlatShading)
                {
                    EditorGUILayout.PropertyField(glitterStrength, new GUIContent("   Glitter Strength", "Snow glitter intensity. Set to zero to disable."));
                }

                EditorGUILayout.LabelField("Slope Options (DX11 only)");
                EditorGUILayout.PropertyField(slopeThreshold, new GUIContent("   Threshold", "The maximum slope where snow can accumulate."));
                EditorGUILayout.PropertyField(slopeSharpness, new GUIContent("   Sharpness", "The sharpness (or smoothness) of the snow at terrain borders."));
                EditorGUILayout.PropertyField(slopeNoise, new GUIContent("   Noise", "Amount of randomization to fill the transient area between low and high slope (determined by slope threshold)."));
                GUI.enabled = true;
                EditorGUILayout.PropertyField(altitudeScatter, new GUIContent("Altitude Scatter", "Defines random snow scattering around minimum altitude level."));
                EditorGUILayout.PropertyField(altitudeBlending, new GUIContent("Altitude Blending", "Defines vertical gradient length for snow blending."));
                if (deferred)
                {
                    EditorGUILayout.PropertyField(snowTint, new GUIContent("Snow Tint", "Global snow threshold."));

                    EditorGUILayout.PropertyField(smoothness, new GUIContent("Roughness", "Snow PBR roughness."));
                }
                EditorGUILayout.PropertyField(maxExposure, new GUIContent("Max Exposure", "Controls maximum snow brightness."));
            }

            EditorGUILayout.Separator();
            expandSection[FEATURE_SETTINGS] = EditorGUILayout.Foldout(expandSection[FEATURE_SETTINGS], sectionNames[FEATURE_SETTINGS], sectionHeaderStyle);

            if (expandSection[FEATURE_SETTINGS])
            {
                if (!deferred && distanceOptimization.boolValue && detailDistance.floatValue <= 0 && (footprints.boolValue || terrainMarks.boolValue))
                {
                    EditorGUILayout.HelpBox("Footprints and Terrain Marks are not supported with Fastest quality setting.", MessageType.Info);
                    GUI.enabled = false;
                }
                EditorGUILayout.PropertyField(footprints, new GUIContent("Footprints", "Enable footprints on snow surface."));
                if (footprints.boolValue)
                {
                    EditorGUILayout.PropertyField(characterController, new GUIContent("   Controller", "The character controller."));
                    EditorGUILayout.PropertyField(footprintsDuration, new GUIContent("   Duration", "Duration of the footprints in seconds before fading out completely."));
                    EditorGUILayout.PropertyField(footprintsAutoFPS, new GUIContent("   FPS Footprints", "Add automatic footprints when camera moves (use only in FPS camera)"));
                    EditorGUILayout.PropertyField(footprintsScale, new GUIContent("   Scale", "Increase to reduce the size of the footprints."));
                    EditorGUILayout.PropertyField(footprintsObscurance, new GUIContent("   Obscurance", "Makes the footprints darker."));
                }
                EditorGUILayout.PropertyField(terrainMarks, new GUIContent("Terrain Marks", "Enable terrain marks based on collisions."));
                if (terrainMarks.boolValue)
                {
                    EditorGUILayout.PropertyField(terrainMarksDuration, new GUIContent("   Duration", "Duration of the terrain marks in seconds before fading out completely."));
                    EditorGUILayout.PropertyField(terrainMarksDefaultSize, new GUIContent("   Default Size", "Default size for a marks produced by automatic collisions. You can call MarkSnowAt() method to specify a custom size."));
                    EditorGUILayout.PropertyField(terrainMarksTextureSize, new GUIContent("   Extents", "Size of the internal texture that holds terrain mark data."));
                    EditorGUILayout.PropertyField(terrainMarksViewDistance, new GUIContent("   View Distance", "Maximum terrain marks render distance to camera. Reduce to avoid marks repetitions or increase extents parameter."));
                    EditorGUILayout.PropertyField(terrainMarksAutoFPS, new GUIContent("   FPS Marks", "Add automatic terrain mark when camera moves (use only in FPS camera)"));
                }
                GUI.enabled = true;
                EditorGUILayout.PropertyField(snowfall, new GUIContent("Snowfall", "Enable snowfall."));
                if (snowfall.boolValue)
                {
                    EditorGUILayout.PropertyField(snowfallIntensity, new GUIContent("   Intensity", "Snowflakes emission rate."));
#if WORLDAPI_PRESENT
                    if (enableWMAPI.boolValue)
                    {
                        EditorGUILayout.HelpBox("Snow fall intensity controlled by World Manager API.", MessageType.Info);
                    }
#endif
                    if (snowfallReceiveShadows.boolValue)
                    {
                        GUI.enabled = false;
                    }
                    EditorGUILayout.PropertyField(snowfallUseIllumination, new GUIContent("   Use Illumination", "If enabled, snow particles will be affected by light."));
                    GUI.enabled = true;
                    EditorGUILayout.PropertyField(snowfallReceiveShadows, new GUIContent("   Receive Shadows", "If enabled, snow particles will receive and cast shadows (affected by illumination in general)."));
                    EditorGUILayout.HelpBox("You can customize particle system prefab located in GlobalSnow/Resources/Prefab folder.", MessageType.Info);
                }
                bool prevBool = cameraFrost.boolValue;
                EditorGUILayout.PropertyField(cameraFrost, new GUIContent("Camera Frost", "Enable camera frost effect."));
                if (cameraFrost.boolValue)
                {
                    EditorGUILayout.PropertyField(cameraFrostIntensity, new GUIContent("   Intensity", "Intensity of camera frost effect."));
                    EditorGUILayout.PropertyField(cameraFrostSpread, new GUIContent("   Spread", "Amplitude of camera frost effect."));
                }
                if (prevBool != cameraFrost.boolValue)
                {
                    cameraFrostedChanged = true;
                }
                EditorGUILayout.PropertyField(enableHotKeys, new GUIContent("Enable HotKeys", "When enabled, you can quickly increase or decrease the snow altitude pressing keys K and I."));
                EditorGUILayout.PropertyField(enableWMAPI, new GUIContent("Enable WMAPI", "Enables integration with World Manager API."));
#if !WORLDAPI_PRESENT
                if (enableWMAPI.boolValue)
                {
                    EditorGUILayout.HelpBox("World Manager API components are not installed. For more information, please visit: https://github.com/adamgoodrich/WorldManager", MessageType.Warning);
                }
#endif
            }
            EditorGUILayout.Separator();


            if (targets.Length == 1)
            {
                expandSection[MASK_EDITOR] = EditorGUILayout.Foldout(expandSection[MASK_EDITOR], sectionNames[MASK_EDITOR], sectionHeaderStyle);
                EditorGUILayout.PropertyField(maskEditorEnabled, new GUIContent("Enable Editor", "Activates terrain brush to paint/remove snow intensity at custom locations."));
                if (maskEditorEnabled.boolValue)
                {
                    if (!coverageMask.boolValue)
                    {
                        EditorGUILayout.BeginVertical(GUI.skin.box);
                        EditorGUILayout.LabelField("Coverage Mask feature is disabled. Enable it?");
                        if (GUILayout.Button("Enable Coverage Mask"))
                        {
                            coverageMask.boolValue = true;
                        }
                        EditorGUILayout.EndVertical();
                        EditorGUILayout.Separator();
                        GUI.enabled = false;
                    }
                    EditorGUILayout.PropertyField(coverageMaskTexture, new GUIContent("Current Mask", "Snow coverage mask. A value of alpha of zero means no snow."));
                    Texture2D tex = (Texture2D)coverageMaskTexture.objectReferenceValue;
                    if (tex != null)
                    {
                        if (currentMaskTexture != tex)
                        {
                            currentMaskTexture             = tex;
                            maskColors                     = currentMaskTexture.GetPixels32();
                            maskTextureResolution.intValue = currentMaskTexture.width;
                        }
                        EditorGUILayout.LabelField("   Texture Size", currentMaskTexture.width.ToString());
                        EditorGUILayout.LabelField("   Texture Path", AssetDatabase.GetAssetPath(currentMaskTexture));
                    }
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.Space();
                    EditorGUILayout.BeginVertical(GUI.skin.box);
                    EditorGUILayout.PropertyField(maskTextureResolution, new GUIContent("Resolution", "Resolution of the mask texture. Higher resolution allows more detail but it can be slower."));
                    if (GUILayout.Button("Create New Mask Texture"))
                    {
                        if (EditorUtility.DisplayDialog("Create Mask Texture", "A texture asset will be created with a size of " + maskTextureResolution.intValue + "x" + maskTextureResolution.intValue + ".\n\nContinue?", "Ok", "Cancel"))
                        {
                            CreateNewMaskTexture();
                        }
                    }
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.Space();
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                    EditorGUILayout.LabelField("World Texture Mapping");
                    EditorGUILayout.PropertyField(coverageMaskWorldSize, new GUIContent("   World Size", "Mapping of the texture against the world in world units. Usually this should match terrain size."));
                    EditorGUILayout.PropertyField(coverageMaskWorldCenter, new GUIContent("   World Center", "Mapping of the texture center against the world in world units. Use this as an offset to apply coverage mask over a certain area."));

                    EditorGUILayout.PropertyField(maskBrushMode, new GUIContent("Brush Mode", "Select brush operation mode."));
                    EditorGUILayout.PropertyField(maskBrushWidth, new GUIContent("   Width", "Width of the snow editor brush."));
                    EditorGUILayout.PropertyField(maskBrushFuzziness, new GUIContent("   Fuzziness", "Solid vs spray brush."));
                    EditorGUILayout.PropertyField(maskBrushOpacity, new GUIContent("   Opacity", "Stroke opacity."));
                    EditorGUILayout.BeginHorizontal();
                    if (currentMaskTexture == null)
                    {
                        GUI.enabled = false;
                    }
                    if (GUILayout.Button("Fill Mask"))
                    {
                        FillMaskTexture(255);
                    }
                    if (GUILayout.Button("Clear Mask"))
                    {
                        FillMaskTexture(0);
                    }

                    GUI.enabled = true;
                    EditorGUILayout.EndHorizontal();
                    EditorGUILayout.Separator();
                }
            }


            if (serializedObject.ApplyModifiedProperties() || forceUpdateProperties)
            {
                gs.UpdateProperties();
                EditorUtility.SetDirty(gs);
                if (cameraFrostedChanged)
                {
                    cameraFrostedChanged = false;
                    EditorGUIUtility.ExitGUI();
                }
            }
        }
    private void Update()
    {
        myText = mainInputField.text.ToLower();

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            disabled = !disabled;
        }
        if (disabled)
        {
            canvas.gameObject.SetActive(false);
            characterController.enabled = true;
        }
        if (!disabled)
        {
            canvas.gameObject.SetActive(true);
            mainInputField.ActivateInputField();
            characterController.enabled = false;
        }


        if (myText == "create desert")
        {
            mainInputField.text = "";
            displayText.text    = "You regret wearing Crocs";
            desertTerrain.SetActive(true);
            snowTerrain.SetActive(false);
            normalCamera.SetActive(true);
            snowCamera.SetActive(false);
            GameObject.Find("SnowParticleSystem").SetActive(false);
        }

        if (myText == "create snow")
        {
            mainInputField.text = "";
            displayText.text    = "Let it snow";
            desertTerrain.SetActive(false);
            snowTerrain.SetActive(true);
            normalCamera.SetActive(false);
            snowCamera.SetActive(true);
            GameObject.Find("SnowParticleSystem").SetActive(true);


            globalSnowEffect.UpdateProperties();
        }


        if (myText == "rain on")
        {
            mainInputField.text   = "";
            displayText.text      = "The world looks a lot more grey all of the sudden...";
            RenderSettings.skybox = rainSkybox;
            rainParticles.SetActive(true);
            directionalLight.enabled = false;
        }

        if (myText == "rain off")
        {
            mainInputField.text   = "";
            displayText.text      = "All must fade eventually, even the dark";
            RenderSettings.skybox = originalSkybox;
            rainParticles.SetActive(false);
            directionalLight.enabled = true;
        }

        if (myText == "create ocean")
        {
            mainInputField.text = "";
            displayText.text    = "You should have brought flippers";
            ocean.SetActive(true);
        }

        if (myText == "create tree")
        {
            mainInputField.text = "";
            displayText.text    = "There is nothing wrong with having a tree as a friend. ― Bob Ross";
            treeSpawner.Spawn();
            globalSnowEffect.UpdateProperties();
        }


        if (myText == "create rock")
        {
            mainInputField.text = "";
            displayText.text    = "No not THE Rock";
            rockSpawner.Spawn();
            globalSnowEffect.UpdateProperties();
        }

        if (myText == "create grass")
        {
            mainInputField.text = "";
            displayText.text    = "Feel the wind blowing through your hair and grass...";
            grassSpawner.Spawn();
        }
    }