示例#1
0
        public override void OnInspectorGUI()
        {
            Undo.RecordObject(target, "Modified Inspector");

            Water2D_Ripple water2D_Ripple = (Water2D_Ripple)target;

            CustomInspector(water2D_Ripple);
        }
示例#2
0
    private void Start()
    {
        water2D = waterObject.GetComponent <Water2D_Tool>();
        sim     = waterObject.GetComponent <Water2D_Simulation>();
        ripple  = waterObject.GetComponent <Water2D_Ripple>();

        rtValue.text = ripple.rtPixelsToUnits.ToString();
        ShowRenderTextureResolution();
        ShowVerticesNumber();
    }
示例#3
0
        /// <summary>
        /// Recalculates the some parameters of the render texture.
        /// </summary>
        private void SetRenderTextureVariables()
        {
            Water2D_Ripple water2DRipple   = GetComponent <Water2D_Ripple>();
            int            rtPixelsToUnits = water2DRipple.rtPixelsToUnits;

            renderTextureWidth  = (int)(Mathf.Ceil(width * rtPixelsToUnits));
            renderTextureHeight = (int)(Mathf.Ceil(length * rtPixelsToUnits));
            rtPixelSize         = 1f / rtPixelsToUnits;

            rRTWidthInWorldSpace  = 1f / (renderTextureWidth * rtPixelSize);
            rRTHeightInWorldSpace = 1f / (renderTextureHeight * rtPixelSize);
        }
示例#4
0
 private void GetReferences()
 {
     frontMeshRend = GetComponent <Renderer>();
     //if (cubeWater)
     //topMeshRend = topMeshGameObject.GetComponent<Renderer>();
     transform = GetComponent <Transform>();
     ripple    = GetComponent <Water2D_Ripple>();
     if (ripple != null)
     {
         water2DRippleScript = true;
     }
 }
示例#5
0
        private void CustomInspector(Water2D_Ripple water2D_Ripple)
        {
            Water2D_Tool       water2D    = water2D_Ripple.GetComponent <Water2D_Tool>();
            Water2D_Simulation water2DSim = water2D_Ripple.GetComponent <Water2D_Simulation>();

            BoldFontStyle(() =>
            {
                water2D_Ripple.showWaterRipple = EditorGUILayout.Foldout(water2D_Ripple.showWaterRipple, "Water Properties");
            });

            if (water2D_Ripple.showWaterRipple)
            {
                InspectorBox(10, () =>
                {
                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.rippleSimulationUpdate = (Water2D_RippleSimulationUpdate)EditorGUILayout.EnumPopup(new GUIContent("Run Simulation In"), water2D_Ripple.rippleSimulationUpdate);
                    if (water2D_Ripple.rippleSimulationUpdate == Water2D_RippleSimulationUpdate.FixedUpdateMethod)
                    {
                        EditorGUILayout.HelpBox("For smooth looking wave movement it is recommended to use Fixed Update Method with physics based character controllers.", MessageType.Info);
                    }

                    if (water2D_Ripple.rippleSimulationUpdate == Water2D_RippleSimulationUpdate.UpdateMethod)
                    {
                        EditorGUILayout.HelpBox("For smooth looking wave movement it is recommended to use Update Method with raycast based character controllers.", MessageType.Info);
                    }

                    if (EditorGUI.EndChangeCheck() && Application.isPlaying)
                    {
                        water2D_Ripple.rainTimeCounter      = 0;
                        water2D_Ripple.heightMapTimeCounter = 0;
                    }

                    if (water2D_Ripple.rippleSimulationUpdate == Water2D_RippleSimulationUpdate.UpdateMethod)
                    {
                        EditorGUI.BeginChangeCheck();
                        water2D_Ripple.rippleWaterFPSCap = EditorGUILayout.Slider(new GUIContent("Simulation Speed", "Determines how many times per second should the height map be processed through the shader that simulates ripple propagation."), water2D_Ripple.rippleWaterFPSCap, 1, 120);

                        if (EditorGUI.EndChangeCheck())
                        {
                            water2D_Ripple.heightUpdateMapTimeStep = 1f / water2D_Ripple.rippleWaterFPSCap;
                            water2D_Ripple.heightMapTimeCounter    = 0;
                            water2D_Ripple.interactionsTimeCounter = 0;
                        }
                    }

                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.waterDamping = EditorGUILayout.Slider(new GUIContent("Damping", "Damping parameter for the water propagation simulation."), water2D_Ripple.waterDamping, 0, 1);
                    if (EditorGUI.EndChangeCheck() && Application.isPlaying)
                    {
                        water2D_Ripple.UpdateRippleShaderParameters();
                    }

                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.rtPixelsToUnits = EditorGUILayout.IntField(new GUIContent("RT Pixels To Units", "The number of Render Texture pixels that should fit in 1 unit of Unity space."), water2D_Ripple.rtPixelsToUnits);
                    if (EditorGUI.EndChangeCheck())
                    {
                        water2D.RecreateWaterMesh();
                    }

                    water2D_Ripple.bicubicResampling = EditorGUILayout.Toggle(new GUIContent("Bicubic Resampling", "Applies a smoothing effect to the heightmap."
                                                                                             + " Eliminates pixelation artifacts. This makes the generated normal map look smoother."), water2D_Ripple.bicubicResampling);

                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.drawBothSides = EditorGUILayout.Toggle(new GUIContent("Draw Both Sides", "Enabling this will make both sides of the top mesh to be drawn when the camera is below the water line."), water2D_Ripple.drawBothSides);
                    if (EditorGUI.EndChangeCheck() && Application.isPlaying)
                    {
                        water2D_Ripple.SetTopMeshCulling();
                    }

                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.waveHeightScale = EditorGUILayout.FloatField(new GUIContent("Wave Height Scale", "The scale of the ripples created by objects or rain."), water2D_Ripple.waveHeightScale);
                    if (EditorGUI.EndChangeCheck())
                    {
                        if (Application.isPlaying)
                        {
                            water2D_Ripple.SetWaveHeightScale();
                        }
                        else
                        {
                            water2D.GetComponent <Renderer>().sharedMaterial.SetFloat("_WaveHeightScale", water2D_Ripple.waveHeightScale);
                            water2D.topMeshGameObject.GetComponent <Renderer>().sharedMaterial.SetFloat("_WaveHeightScale", water2D_Ripple.waveHeightScale);
                        }
                    }

                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.obstructionType = (Water2D_ObstructionType)EditorGUILayout.EnumPopup(new GUIContent("Obstruction Type", "List of obstruction methods."), water2D_Ripple.obstructionType);
                    if (EditorGUI.EndChangeCheck() && Application.isPlaying)
                    {
                        water2D_Ripple.UpdateRippleShaderParameters();
                    }

                    if (water2D_Ripple.obstructionType == Water2D_ObstructionType.DynamicObstruction && !water2D.use3DCollider)
                    {
                        EditorGUILayout.HelpBox("Dynamic Obstruction only works with objects that have a Box Collider or a Sphere Collider", MessageType.Warning);
                    }
                    if (water2D_Ripple.obstructionType == Water2D_ObstructionType.DynamicObstruction)
                    {
                        water2D_Ripple.obstructionLayers = (LayerMask)EditorGUILayout.MaskField("Obstruction Layers", water2D_Ripple.obstructionLayers, InternalEditorUtility.layers);
                    }

                    if (water2D_Ripple.obstructionType == Water2D_ObstructionType.TextureObstruction)
                    {
                        water2D_Ripple.obstructionTexture = EditorGUILayout.ObjectField(new GUIContent("Obstruction Texture"), water2D_Ripple.obstructionTexture, typeof(Texture2D), true) as Texture2D;
                    }
                });
            }

            BoldFontStyle(() =>
            {
                water2D_Ripple.showDynamicObjects = EditorGUILayout.Foldout(water2D_Ripple.showDynamicObjects, "Dynamic Objects");
            });

            if (water2D_Ripple.showDynamicObjects)
            {
                InspectorBox(10, () =>
                {
                    if (water2D.use3DCollider)
                    {
                        water2D_Ripple.fixedRadius = EditorGUILayout.Toggle(new GUIContent("Fixed Radius", "When enabled, the radius of the ripple created by dynamic objects will be the same for all objects. "
                                                                                           + "When disabled the radius of the ripple depends on the collider of that object."), water2D_Ripple.fixedRadius);
                    }
                    if (!water2D.use3DCollider && !water2D_Ripple.fixedRadius)
                    {
                        water2D_Ripple.fixedRadius = true;
                    }

                    if (water2D_Ripple.fixedRadius)
                    {
                        water2D_Ripple.objectRippleRadius = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Radius", "The radius of the ripple created by a dynamic object."), water2D_Ripple.objectRippleRadius), 0.000001f, 100f);
                    }
                    if (!water2D_Ripple.fixedRadius)
                    {
                        water2D_Ripple.objectRadiusScale = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Radius Scale", "Scales up or down the ripple radius. "
                                                                                                                 + "The radius of the ripple created by dynamic objects depends on the size of that objects collider."), water2D_Ripple.objectRadiusScale), 0.000001f, 1000f);
                    }
                    water2D_Ripple.objectRippleStrength = EditorGUILayout.FloatField(new GUIContent("Strength", "The strength of the ripple created by dynamic objects."), water2D_Ripple.objectRippleStrength);
                    water2D_Ripple.strengthScale        = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Y Axis Strength Scale", "Used to scale up or down the strength of the ripples " +
                                                                                                                "created by dynamic objects when the Abs value of the velocity on the Y axis is greater than the Abs value of the velocity on the X axis."), water2D_Ripple.strengthScale), 0.000001f, 1000f);
                    water2D_Ripple.objectVelocityFilter    = EditorGUILayout.FloatField(new GUIContent("Velocity Filter", "If the Abs value of a dynamic object velocity on the X and Y axis is smaller than the value of this field, no ripples will be generated by that object."), water2D_Ripple.objectVelocityFilter);
                    water2D_Ripple.objectXAxisRippleOffset = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("X Axis Relative Offset", "Offsets the ripple position on the X axis based on the width of the colliders bounding box. A value of 0 means that the ripple will be generated at the center of the collider. " +
                                                                                                                   " A value of 0.5f means that the ripple will be positioned at the left or right edge of the colliders bounding box."), water2D_Ripple.objectXAxisRippleOffset), 0, 100f);
                });
            }

            EditorGUI.indentLevel = 0;

            BoldFontStyle(() =>
            {
                water2D_Ripple.showPlayer = EditorGUILayout.Foldout(water2D_Ripple.showPlayer, "Player");
            });

            if (water2D_Ripple.showPlayer)
            {
                InspectorBox(10, () =>
                {
                    water2D_Ripple.playerRippleRadius   = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Radius", "The radius of the ripple created by the player."), water2D_Ripple.playerRippleRadius), 0.0000001f, 1000f);
                    water2D_Ripple.playerRippleStrength = EditorGUILayout.FloatField(new GUIContent("Strength", "The strength of the ripple created by the player."), water2D_Ripple.playerRippleStrength);
                    if (water2DSim.characterControllerType == Water2D_CharacterControllerType.PhysicsBased)
                    {
                        water2D_Ripple.playerVelocityFilter = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Velocity Filter", "If the Abs value of the player velocity on the X and Y axis is smaller than the value of this field, no ripples will be generated by the player."), water2D_Ripple.playerVelocityFilter), 0.0000001f, 100f);
                    }
                    water2D_Ripple.playerRippleXOffset = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("X Axis Position Offset", "Offsets the position of the ripple created by the player on the X axis."), water2D_Ripple.playerRippleXOffset), 0, 1000f);
                });
            }

            EditorGUI.indentLevel = 0;

            BoldFontStyle(() =>
            {
                water2D_Ripple.showRain = EditorGUILayout.Foldout(water2D_Ripple.showRain, "Rain");
            });

            if (water2D_Ripple.showRain)
            {
                InspectorBox(10, () =>
                {
                    water2D_Ripple.rainDrops = EditorGUILayout.Toggle(new GUIContent("Enable Rain", "Enables the simulation of rain."), water2D_Ripple.rainDrops);

                    if (water2D_Ripple.rainDrops)
                    {
                        water2D_Ripple.rainDropRadius    = EditorGUILayout.FloatField(new GUIContent("Drop Radius", "The radius of a rain drop in Unity space."), water2D_Ripple.rainDropRadius);
                        water2D_Ripple.rainDropStrength  = EditorGUILayout.FloatField(new GUIContent("Drop Strength", "The strength of a rain drop."), water2D_Ripple.rainDropStrength);
                        water2D_Ripple.rainDropFrequency = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Drop Frequency", "The number of water drops that should fall in a second."), water2D_Ripple.rainDropFrequency), 0.0001f, 1000f);
                    }
                });
            }

            BoldFontStyle(() =>
            {
                water2D_Ripple.showRippleSourcesList = EditorGUILayout.Foldout(water2D_Ripple.showRippleSourcesList, "Ripple Sources");
            });

            if (water2D_Ripple.showRippleSourcesList)
            {
                InspectorBox(10, () =>
                {
                    water2D_Ripple.rippleSources = EditorGUILayout.Toggle(new GUIContent("Enable Ripple Sources"), water2D_Ripple.rippleSources);

                    if (water2D_Ripple.rippleSources)
                    {
                        water2D_Ripple.rippleSourcesSize = Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("Size"), water2D_Ripple.rippleSourcesSize), 1, 200);
                        if (water2D_Ripple.rippleSourcesList == null)
                        {
                            water2D_Ripple.rippleSourcesList.Add(null);
                        }

                        if (water2D_Ripple.rippleSourcesSize != water2D_Ripple.rippleSourcesList.Count)
                        {
                            if (water2D_Ripple.rippleSourcesSize > water2D_Ripple.rippleSourcesList.Count)
                            {
                                while (water2D_Ripple.rippleSourcesSize > water2D_Ripple.rippleSourcesList.Count)
                                {
                                    water2D_Ripple.rippleSourcesList.Add(null);
                                }
                            }
                            else
                            {
                                while (water2D_Ripple.rippleSourcesSize < water2D_Ripple.rippleSourcesList.Count)
                                {
                                    int last = water2D_Ripple.rippleSourcesList.Count - 1;
                                    water2D_Ripple.rippleSourcesList.RemoveAt(last);
                                }
                            }
                        }

                        for (int i = 0; i < water2D_Ripple.rippleSourcesList.Count; i++)
                        {
                            water2D_Ripple.rippleSourcesList[i] = EditorGUILayout.ObjectField(new GUIContent("Element " + i), water2D_Ripple.rippleSourcesList[i], typeof(RippleSource), true) as RippleSource;
                        }
                    }
                });
            }

            if (water2D.use3DCollider)
            {
                BoldFontStyle(() =>
                {
                    water2D_Ripple.showMouse = EditorGUILayout.Foldout(water2D_Ripple.showMouse, "Mouse Interaction");
                });

                if (water2D_Ripple.showMouse)
                {
                    InspectorBox(10, () =>
                    {
                        water2D_Ripple.mouseInteraction = EditorGUILayout.Toggle(new GUIContent("Enable Mouse Interaction", "Enables the ability to interact with the water using the mouse arrow."), water2D_Ripple.mouseInteraction);

                        if (water2D_Ripple.mouseInteraction)
                        {
                            water2D_Ripple.mouseRadius  = EditorGUILayout.FloatField(new GUIContent("Mouse Radius", "The radius of the ripple created by the mouse arrow, in Unity space."), water2D_Ripple.mouseRadius);
                            water2D_Ripple.mouseStregth = EditorGUILayout.FloatField(new GUIContent("Mouse Strength", "The strength of the ripple created by the mouse arrow."), water2D_Ripple.mouseStregth);
                        }
                    });
                }
            }

            BoldFontStyle(() =>
            {
                water2D_Ripple.showAmbiantWaves = EditorGUILayout.Foldout(water2D_Ripple.showAmbiantWaves, "Ambient Waves");
            });

            if (water2D_Ripple.showAmbiantWaves)
            {
                InspectorBox(10, () =>
                {
                    EditorGUI.BeginChangeCheck();
                    water2D_Ripple.ambientWaves = EditorGUILayout.Toggle(new GUIContent("Enable Ambient Waves", "Enable this to simulate waves created by the wind."), water2D_Ripple.ambientWaves);

                    if (water2D_Ripple.ambientWaves)
                    {
                        water2D_Ripple.amplitudeZAxisFade = EditorGUILayout.Toggle(new GUIContent("Z Axis Amplitude Fade", "When enabled the amplitude of the sine waves will fade along the Z axis."), water2D_Ripple.amplitudeZAxisFade);

                        if (water2D_Ripple.amplitudeZAxisFade)
                        {
                            water2D_Ripple.amplitudeFadeStart = EditorGUILayout.Slider(new GUIContent("Fade Start", "The start point of the amplitude fade. Can also be used to set the direction of the amplitude fade. If the start point value is greater than the end point, the amplitude will fade from back to front."), water2D_Ripple.amplitudeFadeStart, 0, 1.0f);
                            water2D_Ripple.amplitudeFadeEnd   = EditorGUILayout.Slider(new GUIContent("Fade End", "The end point of the amplitude fade. Can also be used to set the direction of the amplitude fade. If the end point value is greater than the start point, the amplitude will fade towards the back of the water."), water2D_Ripple.amplitudeFadeEnd, 0, 1.0f);
                        }

                        EditorGUILayout.LabelField(new GUIContent("Wave 1"), EditorStyles.boldLabel);

                        water2D_Ripple.amplitude1   = EditorGUILayout.FloatField(new GUIContent("Amplitude", "Sine wave amplitude. The bigger the value the higher the wave top will be."), water2D_Ripple.amplitude1);
                        water2D_Ripple.waveLength1  = EditorGUILayout.FloatField(new GUIContent("Wave Length", "The distance between 2 consecutive points of a sine wave."), water2D_Ripple.waveLength1);
                        water2D_Ripple.phaseOffset1 = EditorGUILayout.FloatField(new GUIContent("Phase Offset", "Sine wave phase offset. The bigger the value of the phase offset the faster the waves move to the left (right)."), water2D_Ripple.phaseOffset1);

                        EditorGUILayout.LabelField(new GUIContent("Wave 2"), EditorStyles.boldLabel);

                        water2D_Ripple.amplitude2   = EditorGUILayout.FloatField(new GUIContent("Amplitude", "Sine wave amplitude. The bigger the value the higher the wave top will be."), water2D_Ripple.amplitude2);
                        water2D_Ripple.waveLength2  = EditorGUILayout.FloatField(new GUIContent("Wave Length", "The distance between 2 consecutive points of a sine wave."), water2D_Ripple.waveLength2);
                        water2D_Ripple.phaseOffset2 = EditorGUILayout.FloatField(new GUIContent("Phase Offset", "Sine wave phase offset. The bigger the value of the phase offset the faster the waves move to the left (right)."), water2D_Ripple.phaseOffset2);

                        EditorGUILayout.LabelField(new GUIContent("Wave 3"), EditorStyles.boldLabel);

                        water2D_Ripple.amplitude3   = EditorGUILayout.FloatField(new GUIContent("Amplitude", "Sine wave amplitude. The bigger the value the higher the wave top will be."), water2D_Ripple.amplitude3);
                        water2D_Ripple.waveLength3  = EditorGUILayout.FloatField(new GUIContent("Wave Length", "The distance between 2 consecutive points of a sine wave."), water2D_Ripple.waveLength3);
                        water2D_Ripple.phaseOffset3 = EditorGUILayout.FloatField(new GUIContent("Phase Offset", "Sine wave phase offset. The bigger the value of the phase offset the faster the waves move to the left (right)."), water2D_Ripple.phaseOffset3);
                    }
                    if (EditorGUI.EndChangeCheck() && Application.isPlaying)
                    {
                        water2D_Ripple.SetAmbientWavesShaderParameters();
                    }
                });
            }
        }
        private void CustomInspector(Water2D_Simulation water2D_Sim)
        {
            Water2D_Ripple rippleScript = water2D_Sim.GetComponent <Water2D_Ripple>();

            if (!rippleScript)
            {
                BoldFontStyle(() =>
                {
                    water2D_Sim.showSpringProperties = EditorGUILayout.Foldout(water2D_Sim.showSpringProperties, "Spring");
                });
            }

            if (water2D_Sim.showSpringProperties && !rippleScript)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.springSimulation = EditorGUILayout.Toggle(new GUIContent("Spring Simulation", "Enables the simulation of springs. This what makes the surface of the water react to objects."), water2D_Sim.springSimulation);

                    if (water2D_Sim.springSimulation)
                    {
                        water2D_Sim.springConstant = EditorGUILayout.FloatField(new GUIContent("Spring Constant", "This value controls the stiffness of the springs. "
                                                                                               + "A low spring constant will make the springs loose. This means a force will cause large waves that oscillate slowly. A high spring "
                                                                                               + "constant will increase the tension in the spring. Forces will create small waves that oscillate quickly."), water2D_Sim.springConstant);

                        water2D_Sim.damping = EditorGUILayout.FloatField(new GUIContent("Damping", "The damping slows down the oscillation of the springs. "
                                                                                        + " A high dampening value will make the water look thick like molasses, while a low value will allow the waves to oscillate for a long time."), water2D_Sim.damping);

                        water2D_Sim.spread = EditorGUILayout.FloatField(new GUIContent("Spread", "Controls how fast the waves spread."), water2D_Sim.spread);

                        water2D_Sim.collisionVelocityScale = EditorGUILayout.FloatField(new GUIContent("Collision Velocity", "Limits the velocity "
                                                                                                       + " a spring will receive from a falling object."), water2D_Sim.collisionVelocityScale);

                        water2D_Sim.waveSpeed = EditorGUILayout.FloatField(new GUIContent("Wave Speed", "Another variable to control the spread speed of the waves."), water2D_Sim.waveSpeed);

                        Water2D_Tool water2D_Tool = water2D_Sim.GetComponent <Water2D_Tool>();
                        if (water2D_Tool.use3DCollider)
                        {
                            water2D_Sim.overlapSphereRadius = EditorGUILayout.FloatField(new GUIContent("Overlap Sphere Radius", "The radius of a sphere that will be used to check "
                                                                                                        + " if there is a 3D collider near a surface vertex."), water2D_Sim.overlapSphereRadius);
                        }

                        water2D_Sim.interactionTime = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Spring Simulation Time", "How many seconds after an object interacted with the water surface and generated a ripple, should the spring simulation stop updating."), water2D_Sim.interactionTime), 0.00001f, 100);
                    }
                });
            }

            if (water2D_Sim.waterType == Water2D_Type.Dynamic)
            {
                BoldFontStyle(() =>
                {
                    water2D_Sim.showfloatingBuoyantForce = EditorGUILayout.Foldout(water2D_Sim.showfloatingBuoyantForce, "Buoyancy");
                });

                if (water2D_Sim.showfloatingBuoyantForce)
                {
                    InspectorBox(10, () =>
                    {
                        water2D_Sim.buoyantForceMode = (Water2D_BuoyantForceMode)EditorGUILayout.EnumPopup(new GUIContent("Buoyant Force", "List of methods to simulate the buoyant force. "
                                                                                                                          + "This is what makes the objects float in the water"), water2D_Sim.buoyantForceMode);

                        if (water2D_Sim.buoyantForceMode != Water2D_BuoyantForceMode.None)
                        {
                            if (water2D_Sim.buoyantForceMode == Water2D_BuoyantForceMode.Linear)
                            {
                                water2D_Sim.floatHeight = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Float Height", "Determines how much force should be applied to an object submerged "
                                                                                                                + "in the water. A value of 3 means that 3 m under the water the force applied to an object will be 2 times greater than the force applied at the "
                                                                                                                + "surface of the water."), water2D_Sim.floatHeight), 0.0001f, 100);

                                water2D_Sim.bounceDamping = EditorGUILayout.FloatField(new GUIContent("Bounce Damping", "Slows down the vertical oscillation of the object."), water2D_Sim.bounceDamping);

                                water2D_Sim.liniarBFDragCoefficient = EditorGUILayout.FloatField(new GUIContent("Drag Coefficient", "Determines how much drag force should be applied to an object."), water2D_Sim.liniarBFDragCoefficient);

                                water2D_Sim.liniarBFAbgularDragCoefficient = EditorGUILayout.FloatField(new GUIContent("Angular Drag Coefficient", "Slow down the angular rotation of the object."), water2D_Sim.liniarBFAbgularDragCoefficient);

                                water2D_Sim.forceScale = EditorGUILayout.FloatField(new GUIContent("Force Scale", "A value of 1 will make an object with the mass of "
                                                                                                   + " 1kg float at the surface of the water and an object with the mass of 2kg float 3m below the water surface if Float Height "
                                                                                                   + "is set to 3m."), water2D_Sim.forceScale);

                                water2D_Sim.forcePositionOffset = EditorGUILayout.Vector3Field(new GUIContent("Force Position Offset", "By default the force will "
                                                                                                              + " be applied at the center of the object. Use this to offset the position where the force will be applied to an object."), water2D_Sim.forcePositionOffset);
                            }
                            else
                            {
                                water2D_Sim.clippingMethod = (Water2D_ClippingMethod)EditorGUILayout.EnumPopup(new GUIContent("Polygon Clipping", "Determines which clipping method will be used to calculate the shape of the polygon that is below the water. "
                                                                                                                              + "The simple clipping is the cheapest option in terms of performance because the clipping polygon is always a horizontal line."
                                                                                                                              + "The complex option is best to use when you want the objects to better react to water waves."), water2D_Sim.clippingMethod);

                                if (water2D_Sim.clippingMethod == Water2D_ClippingMethod.Complex)
                                {
                                    water2D_Sim.showClippingPlolygon = EditorGUILayout.Toggle(new GUIContent("Show Clipping Polygon", "When enabled will show in the Scene View the shape of the clipping polygon."), water2D_Sim.showClippingPlolygon);

                                    water2D_Sim.meshSegmentsPerWaterLineSegment = Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("Water Line Segments", "The number of vertical mesh segments that should fit in a water line segment."), water2D_Sim.meshSegmentsPerWaterLineSegment), 1, 1000);
                                }

                                water2D_Sim.polygonCorners = Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("Polygon Vertices", "When an object with a circleCollider2D "
                                                                                                                 + "is detected an imaginary regular polygon collider is created based on its radius and position. "
                                                                                                                 + "Use this to set the number of vertices the regular polygon collider should have."), water2D_Sim.polygonCorners), 4, 100);

                                water2D_Sim.dragCoefficient = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Drag Coefficient", "Determines how much drag force should be applied to an object."), water2D_Sim.dragCoefficient), 0, 500);
                                water2D_Sim.liftCoefficient = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Lift Coefficient", "Determines how much lift force should be applied to an object."), water2D_Sim.liftCoefficient), 0, 500);

                                water2D_Sim.waterDensity = EditorGUILayout.FloatField(new GUIContent("Water Density", "Sets the water density. In a water with low "
                                                                                                     + " density the objects will submerge faster and come to the surface slower. If the water density is great the objects will "
                                                                                                     + "stay more at the surface of the water and will submerge slower."), water2D_Sim.waterDensity);

                                water2D_Sim.showPolygon = EditorGUILayout.Toggle(new GUIContent("Show Polygon Shape", "When enabled will show in the Scene View the shape of the polygon that is below the waterline."), water2D_Sim.showPolygon);
                                water2D_Sim.showForces  = EditorGUILayout.Toggle(new GUIContent("Show Forces", "When enabled will show in the Scene View the velocity direction, drag direction, "
                                                                                                + "lift direction and the normal of a leading edge."), water2D_Sim.showForces);
                            }
                        }
                    });
                }
            }

            BoldFontStyle(() =>
            {
                water2D_Sim.showFlow = EditorGUILayout.Foldout(water2D_Sim.showFlow, "Flow");
            });

            if (water2D_Sim.showFlow)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.waterFlow = EditorGUILayout.Toggle(new GUIContent("Water Flow", "When enabled, the water flow will affect the objects in the water."), water2D_Sim.waterFlow);
                    if (water2D_Sim.waterFlow)
                    {
                        water2D_Sim.useAngles = EditorGUILayout.Toggle(new GUIContent("Use Angles", "Enable this if you want to control the direction of the water flow using custom angle values."), water2D_Sim.useAngles);

                        if (!water2D_Sim.useAngles)
                        {
                            water2D_Sim.flowDirection = (Water2D_FlowDirection)EditorGUILayout.EnumPopup(new GUIContent("Flow Direction", "The direction of the water flow."), water2D_Sim.flowDirection);
                        }

                        if (water2D_Sim.useAngles)
                        {
                            water2D_Sim.flowAngle = EditorGUILayout.FloatField(new GUIContent("Flow Angle", "The angle of the water flow. " + "When set to 0 degrees the objects will be pushed to the left, "
                                                                                              + "when set to 90 degrees the objects will be pushed down, when set to 180 degrees the objects will "
                                                                                              + "be pushed to the right, when set to 270 degrees the objects will be pushed up."), water2D_Sim.flowAngle);
                        }

                        water2D_Sim.waterFlowForce = EditorGUILayout.FloatField(new GUIContent("Flow Force", "The force of the water flow."), water2D_Sim.waterFlowForce);
                    }
                });
            }

            BoldFontStyle(() =>
            {
                water2D_Sim.showAnimation = EditorGUILayout.Foldout(water2D_Sim.showAnimation, "Animation");
            });

            if (water2D_Sim.showAnimation)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.animationMethod = (Water2D_AnimationMethod)EditorGUILayout.EnumPopup(new GUIContent("Animation Method", "Determines the animation method for the handles position."), water2D_Sim.animationMethod);

                    if (water2D_Sim.animationMethod != Water2D_AnimationMethod.None)
                    {
                        if (!rippleScript)
                        {
                            water2D_Sim.animateWaterArea = EditorGUILayout.Toggle(new GUIContent("Animate Water Area", "Enable this "
                                                                                                 + "if you want to animate the increase or decrease of the total water area."), water2D_Sim.animateWaterArea);
                        }

                        if (!water2D_Sim.animateWaterArea)
                        {
                            water2D_Sim.topEdge = EditorGUILayout.ObjectField(new GUIContent("Top Edge", "Place here an animated object "
                                                                                             + "you want the water line (the top of the water) to follow."), water2D_Sim.topEdge, typeof(Transform), true) as Transform;
                        }

                        if (!rippleScript)
                        {
                            water2D_Sim.bottomEdge = EditorGUILayout.ObjectField(new GUIContent("Bottom Edge", "Place here an animated object "
                                                                                                + "you want the bottom edge of the water to follow."), water2D_Sim.bottomEdge, typeof(Transform), true) as Transform;

                            water2D_Sim.leftEdge = EditorGUILayout.ObjectField(new GUIContent("Left Edge", "Place here an animated object you "
                                                                                              + " want the left edge of the water to follow."), water2D_Sim.leftEdge, typeof(Transform), true) as Transform;

                            water2D_Sim.rightEdge = EditorGUILayout.ObjectField(new GUIContent("Right Edge", "Place here an animated object "
                                                                                               + "you want the right edge of the water to follow."), water2D_Sim.rightEdge, typeof(Transform), true) as Transform;
                        }

                        if (water2D_Sim.animationMethod == Water2D_AnimationMethod.Snap)
                        {
                            if (!water2D_Sim.animateWaterArea)
                            {
                                water2D_Sim.topEdgeYOffset = EditorGUILayout.FloatField(new GUIContent("Top Edge Y Offset", "The offset on the Y axis from the position of a referenced object."), water2D_Sim.topEdgeYOffset);
                            }
                            if (!rippleScript)
                            {
                                water2D_Sim.bottomEdgeYOffset = EditorGUILayout.FloatField(new GUIContent("Bottom Edge Y Offset", "The offset on the Y axis from the position of a referenced object."), water2D_Sim.bottomEdgeYOffset);
                                water2D_Sim.leftEdgeXOffset   = EditorGUILayout.FloatField(new GUIContent("Left Edge X Offset", "The offset on the X axis from the position of a referenced object."), water2D_Sim.leftEdgeXOffset);
                                water2D_Sim.rightEdgeXOffset  = EditorGUILayout.FloatField(new GUIContent("Right Edge X Offset", "The offset on the X axis from the position of a referenced object."), water2D_Sim.rightEdgeXOffset);
                            }
                        }

                        if (water2D_Sim.animateWaterArea && water2D_Sim.topEdge != null)
                        {
                            water2D_Sim.topEdge = null;
                        }
                    }
                });
            }

            if (!rippleScript)
            {
                BoldFontStyle(() =>
                {
                    water2D_Sim.showSurfaceWaves = EditorGUILayout.Foldout(water2D_Sim.showSurfaceWaves, "Surface Waves");
                });
            }

            if (water2D_Sim.showSurfaceWaves && !rippleScript)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.surfaceWaves = (Water2D_SurfaceWaves)EditorGUILayout.EnumPopup(new GUIContent("Surface Waves", "List of methods to generate surface waves. Random"
                                                                                                              + " method generates small random splashes. Sine wave method overlaps a number of sine waves to  get a final wave that changes the velocity of the surface vertices."), water2D_Sim.surfaceWaves);

                    if (water2D_Sim.surfaceWaves != Water2D_SurfaceWaves.None)
                    {
                        if (water2D_Sim.surfaceWaves == Water2D_SurfaceWaves.SineWaves)
                        {
                            water2D_Sim.sineWavesType = (Water2D_SineWaves)EditorGUILayout.EnumPopup(new GUIContent("Sine Waves", "The type of sine waves to use. If you want to animate the amplitude and stretch of the sine wave use the Single Sine Wave option."), water2D_Sim.sineWavesType);

                            if (water2D_Sim.sineWavesType == Water2D_SineWaves.MultipleSineWaves)
                            {
                                water2D_Sim.randomValues = EditorGUILayout.Toggle(new GUIContent("Random Values", "When enabled, the amplitude, stretch and phase offset will be random values for each sine wave."), water2D_Sim.randomValues);
                            }

                            if (water2D_Sim.sineWavesType == Water2D_SineWaves.MultipleSineWaves)
                            {
                                water2D_Sim.sineWaves = Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("Sine Waves Number", "The number of individual sine waves."), water2D_Sim.sineWaves), 1, 100);

                                if (water2D_Sim.randomValues)
                                {
                                    water2D_Sim.maxAmplitude = EditorGUILayout.FloatField(new GUIContent("Max Amplitude", "The constant is used to generate a random amplitude value between a Max and a Min. Controls the height of the sine wave."), water2D_Sim.maxAmplitude);
                                    water2D_Sim.minAmplitude = EditorGUILayout.FloatField(new GUIContent("Min Amplitude", "The constant is used to generate a random amplitude value between a Max and a Min. Controls the height of the sine wave."), water2D_Sim.minAmplitude);

                                    water2D_Sim.maxStretch = EditorGUILayout.FloatField(new GUIContent("Max Stretch", "The constant is used to generate a random sine wave stretch value between a Max and a Min. "
                                                                                                       + "The bigger the value of the stretch the more compact the waves are."), water2D_Sim.maxStretch);
                                    water2D_Sim.minStretch = EditorGUILayout.FloatField(new GUIContent("Min Stretch", "The constant is used to generate a random sine wave stretch value between a Max and a Min. "
                                                                                                       + "The bigger the value of the stretch the more compact the waves are."), water2D_Sim.minStretch);

                                    water2D_Sim.maxPhaseOffset = EditorGUILayout.FloatField(new GUIContent("Max Phase Offset", "The constant is used to generate a random phase offset value between a Max and a Min. "
                                                                                                           + "The bigger the value of the phase offset the faster the waves move to the left (right)."), water2D_Sim.maxPhaseOffset);
                                    water2D_Sim.minPhaseOffset = EditorGUILayout.FloatField(new GUIContent("Min Phase Offset", "The constant is used to generate a random phase offset value between a Max and a Min. "
                                                                                                           + "The bigger the value of the phase offset the faster the waves move to the left (right)."), water2D_Sim.minPhaseOffset);
                                }
                                else
                                {
                                    if (water2D_Sim.sineAmplitudes.Count != water2D_Sim.sineWaves)
                                    {
                                        water2D_Sim.sineAmplitudes.Clear();
                                        water2D_Sim.sineStretches.Clear();
                                        water2D_Sim.phaseOffset.Clear();

                                        for (int i = 0; i < water2D_Sim.sineWaves; i++)
                                        {
                                            water2D_Sim.sineAmplitudes.Add(Random.Range(water2D_Sim.minAmplitude, water2D_Sim.maxAmplitude));
                                            water2D_Sim.sineStretches.Add(Random.Range(water2D_Sim.minStretch, water2D_Sim.maxStretch));
                                            water2D_Sim.phaseOffset.Add(Random.Range(water2D_Sim.minPhaseOffset, water2D_Sim.maxPhaseOffset));
                                        }
                                    }
                                    else
                                    {
                                        int n = 0;
                                        for (int i = 0; i < water2D_Sim.sineWaves; i++)
                                        {
                                            n = i + 1;
                                            EditorGUILayout.LabelField(new GUIContent("Sine Wave " + n), EditorStyles.boldLabel);

                                            water2D_Sim.sineAmplitudes[i] = EditorGUILayout.FloatField(new GUIContent("Amplitude", "The amplitude of the wave. This value controls the height of the sine wave."), water2D_Sim.sineAmplitudes[i]);
                                            water2D_Sim.sineStretches[i]  = EditorGUILayout.FloatField(new GUIContent("Stretch", "The bigger the value of the stretch the more compact the waves are."), water2D_Sim.sineStretches[i]);
                                            water2D_Sim.phaseOffset[i]    = EditorGUILayout.FloatField(new GUIContent("Phase Offset", "The bigger the value of the phase offset the faster the waves move to the left (right). "
                                                                                                                      + " A negative value will make the sine wave move to the right."), water2D_Sim.phaseOffset[i]);
                                        }
                                    }
                                }
                            }
                            else
                            {
                                water2D_Sim.waveAmplitude   = EditorGUILayout.FloatField(new GUIContent("Wave Amplitude", "The amplitude of the wave. This value controls the height of the sine wave."), water2D_Sim.waveAmplitude);
                                water2D_Sim.waveStretch     = EditorGUILayout.FloatField(new GUIContent("Wave Stretch", "The bigger the value of the stretch the more compact the waves are."), water2D_Sim.waveStretch);
                                water2D_Sim.wavePhaseOffset = EditorGUILayout.FloatField(new GUIContent("Wave Phase Offset", "The bigger the value of the phase offset the faster the waves move to the left (right)."
                                                                                                        + " A negative value will make the sine wave move to the right."), water2D_Sim.wavePhaseOffset);
                            }

                            water2D_Sim.sineWaveVelocityScale = EditorGUILayout.FloatField(new GUIContent("Sine Wave Velocity Scale", "Will scale down (up) the velocity that is applied to a vertex from a sine wave."), water2D_Sim.sineWaveVelocityScale);
                        }

                        if (water2D_Sim.surfaceWaves == Water2D_SurfaceWaves.RandomSplashes)
                        {
                            water2D_Sim.timeStep    = EditorGUILayout.FloatField(new GUIContent("Wave Time Step", "The time between splashes."), water2D_Sim.timeStep);
                            water2D_Sim.maxVelocity = EditorGUILayout.FloatField(new GUIContent("Max Velocity", "The constant is used to generate a random velocity between a Max and a Min."), water2D_Sim.maxVelocity);
                            water2D_Sim.minVelocity = EditorGUILayout.FloatField(new GUIContent("Min Velocity", "The constant is used to generate a random velocity between a Max and a Min."), water2D_Sim.minVelocity);
                            water2D_Sim.neighborVertVelocityScale = EditorGUILayout.FloatField(new GUIContent("Neighbor Vertex Velocity Scale", "Will scale down (up) the velocity that "
                                                                                                              + "is applied to the neighbor vertices when RandomWave method is called."), water2D_Sim.neighborVertVelocityScale);
                        }
                    }
                });
            }

            BoldFontStyle(() =>
            {
                water2D_Sim.showPlayerSettings = EditorGUILayout.Foldout(water2D_Sim.showPlayerSettings, "Player");
            });

            if (water2D_Sim.showPlayerSettings)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.characterControllerType = (Water2D_CharacterControllerType)EditorGUILayout.EnumPopup(new GUIContent("Character Controller", "If you are using a physics based character controller select Physics Based option, otherwise select Raycast Based."), water2D_Sim.characterControllerType);

                    if (water2D_Sim.characterControllerType == Water2D_CharacterControllerType.PhysicsBased)
                    {
                        water2D_Sim.playerBoundingBoxSize = EditorGUILayout.Vector2Field(new GUIContent("Player BBox Size", "The size for the players bounding box. In most cases the player character will have more than one collider. "
                                                                                                        + "So to simplify the things, Water2D uses this variable to set the size for an imaginary bounding box that will be used when applying buoyant force. "), water2D_Sim.playerBoundingBoxSize);

                        water2D_Sim.playerBoundingBoxCenter = EditorGUILayout.Vector2Field(new GUIContent("Player BBox Center", "By default the center of the bounding box will be "
                                                                                                          + "the transform.position of the object. Use this variable to offset the players bounding box center."), water2D_Sim.playerBoundingBoxCenter);

                        water2D_Sim.playerBuoyantForceScale = EditorGUILayout.FloatField(new GUIContent("Player Buoyant Force Scale", "Depending on what character controller you are using, you may have a big character "
                                                                                                        + "that must have a small mass. As a result the Player will not submerge in the water because of its low mass that results in low density. To resolve this problem use this variable to scale "
                                                                                                        + "down the buoyant force applied to the Player."), water2D_Sim.playerBuoyantForceScale);

                        water2D_Sim.playerOnExitPSAndSound = EditorGUILayout.Toggle(new GUIContent("On Exit PS and Sound", "When enabled, a particles system will be instantiated and a sound effect will be played when the player exits the water."), water2D_Sim.playerOnExitPSAndSound);
                        water2D_Sim.playerOnExitRipple     = EditorGUILayout.Toggle(new GUIContent("On Exit Ripple", "When enabled, a ripple will be generated when the player exits the water."), water2D_Sim.playerOnExitRipple);

                        if (!rippleScript && water2D_Sim.playerOnExitRipple)
                        {
                            water2D_Sim.playerOnExitVelocity = EditorGUILayout.FloatField(new GUIContent("On Exit Velocity", "The velocity that should be applied to a surface vertex when the player exits the water."), water2D_Sim.playerOnExitVelocity);
                        }
                    }
                    else
                    {
                        if (!rippleScript)
                        {
                            water2D_Sim.rippleWidth           = EditorGUILayout.FloatField(new GUIContent("Ripple Width", "The initial width of the water wave."), water2D_Sim.rippleWidth);
                            water2D_Sim.playerOnEnterVelocity = EditorGUILayout.FloatField(new GUIContent("On Enter Velocity", "The velocity that will be applied to the surface vertices to generate a wave."), water2D_Sim.playerOnEnterVelocity);

                            if (water2D_Sim.playerOnExitRipple)
                            {
                                water2D_Sim.playerOnExitVelocity = EditorGUILayout.FloatField(new GUIContent("On Exit Velocity", "The velocity that should be applied to a surface vertex when the player exits the water."), water2D_Sim.playerOnExitVelocity);
                            }
                        }

                        water2D_Sim.playerOnExitRipple     = EditorGUILayout.Toggle(new GUIContent("On Exit Ripple", "When enabled, a ripple will be generated when the player exits the water."), water2D_Sim.playerOnExitRipple);
                        water2D_Sim.playerOnExitPSAndSound = EditorGUILayout.Toggle(new GUIContent("On Exit PS and Sound", "When enabled, a particles system will be instantiated and a sound effect will be played when the player exits the water."), water2D_Sim.playerOnExitPSAndSound);
                    }
                });
            }

            BoldFontStyle(() =>
            {
                water2D_Sim.showMiscellaneous = EditorGUILayout.Foldout(water2D_Sim.showMiscellaneous, "Miscellaneous");
            });

            if (water2D_Sim.showMiscellaneous)
            {
                InspectorBox(10, () =>
                {
                    water2D_Sim.waterType = (Water2D_Type)EditorGUILayout.EnumPopup(new GUIContent("Water Type", "A list of water types. "
                                                                                                   + "A dynamic water can be animated and reacts to objects. A decorative water can be animated, but will not react "
                                                                                                   + " to objects and will not influence their position."), water2D_Sim.waterType);

                    water2D_Sim.collisionLayers = (LayerMask)EditorGUILayout.MaskField("Collider Mask", water2D_Sim.collisionLayers, InternalEditorUtility.layers);

                    if (!rippleScript && water2D_Sim.springSimulation)
                    {
                        water2D_Sim.collisionDetectionMode = (Water2D_CollisionDetectionMode)EditorGUILayout.EnumPopup(new GUIContent("Collider Detection", "When Raycast Based option is selected, for every dynamic object that is near the surface of the water a ray cast "
                                                                                                                                      + "if performed for every vertex that is inside the bounding box of that objects collider. This is done to find if a particular vertex is inside the collider and not only his bounding box. If the vertex is inside the collider, his velocity is "
                                                                                                                                      + "changed based on the velocity of the dynamic object. If Bounds Based option is selected, no raycast is perfomed and instead the vertex position relative to the objects bounding box is used to determine if a vertex velocity should be changed by an object."), water2D_Sim.collisionDetectionMode);

                        if (water2D_Sim.collisionDetectionMode == Water2D_CollisionDetectionMode.RaycastBased)
                        {
                            water2D_Sim.raycastDistance = Mathf.Clamp(EditorGUILayout.FloatField(new GUIContent("Raycast Distance", "How far to the left and right from a vertex world position should we look for a collider. "), water2D_Sim.raycastDistance), 0, 100);
                        }
                    }

                    if (water2D_Sim.waterType == Water2D_Type.Decorative)
                    {
                        Water2D_Tool water2D_Tool = water2D_Sim.GetComponent <Water2D_Tool>();
                        if (water2D_Tool.createCollider)
                        {
                            water2D_Tool.createCollider = false;
                            water2D_Tool.RecreateWaterMesh();
                        }
                    }
                    else
                    {
                        Water2D_Tool water2D_Tool = water2D_Sim.GetComponent <Water2D_Tool>();
                        if (!water2D_Tool.createCollider)
                        {
                            water2D_Tool.createCollider = true;
                            water2D_Tool.RecreateWaterMesh();
                        }
                    }

                    if (water2D_Sim.waterType == Water2D_Type.Dynamic)
                    {
                        if (!rippleScript)
                        {
                            water2D_Sim.velocityFilter = EditorGUILayout.FloatField(new GUIContent("Velocity Filter", "An object with a velocity on the Y axis "
                                                                                                   + " greater than the value of Velocity Filter will not create splashes."), water2D_Sim.velocityFilter);

                            water2D_Sim.interactionRegion = EditorGUILayout.FloatField(new GUIContent("Interaction Region", "The bottom region of a colliders bounding box "
                                                                                                      + "that can affect the velocity of a vertex. This value is used to limit the ability of the objects with big bounding boxes to affect the "
                                                                                                      + "velocity of the surface vertices. A value of 1 means that only the first 1m of the bottom of the bounding box will affect the velocity "
                                                                                                      + "of the surface vertices. "), water2D_Sim.interactionRegion);

                            water2D_Sim.waterDisplacement = EditorGUILayout.Toggle(new GUIContent("Water Displacement", "Floating objects will influence the final water area."), water2D_Sim.waterDisplacement);
                        }
                    }

                    if (!rippleScript)
                    {
                        water2D_Sim.constantWaterArea = EditorGUILayout.Toggle(new GUIContent("Constant Water Area", "If the width of the water changes, the height will " +
                                                                                              " change too, to keep a constant water Area."), water2D_Sim.constantWaterArea);
                    }

                    if (water2D_Sim.waterType == Water2D_Type.Dynamic)
                    {
                        water2D_Sim.particleS = EditorGUILayout.ObjectField(new GUIContent("PS Prefab", "A particle system prefab used to simulate the water splash effect."), water2D_Sim.particleS, typeof(GameObject), true) as GameObject;
                        water2D_Sim.particleSystemPosOffset = EditorGUILayout.Vector3Field(new GUIContent("PS Position Offset", "Offsets the position where the particle systems are created on the Z axis."), water2D_Sim.particleSystemPosOffset);

                        water2D_Sim.particleSystemSorting = EditorGUILayout.Toggle(new GUIContent("PS Sorting", "Enable this toggle if you want to set the sorting layer and order in layer of the particle system when it is instantiated."), water2D_Sim.particleSystemSorting);

                        if (water2D_Sim.particleSystemSorting)
                        {
                            water2D_Sim.particleSystemSortingLayerName = EditorGUILayout.TextField(new GUIContent("PS Sorting Layer Name", "Insert here the sorting layer name for the particle system."), water2D_Sim.particleSystemSortingLayerName);
                            water2D_Sim.particleSystemOrderInLayer     = EditorGUILayout.IntField(new GUIContent("PS Order In Layer", "Insert here the order in layer for the particle system."), water2D_Sim.particleSystemOrderInLayer);
                        }

                        water2D_Sim.splashSound = EditorGUILayout.ObjectField(new GUIContent("Sound Effect", "A sound effect generated when an object hits the water surface."), water2D_Sim.splashSound, typeof(AudioClip), true) as AudioClip;
                    }
                });
            }
        }