├── LICENSE ├── README.md ├── assets ├── For demonstration.meta ├── For demonstration │ ├── 50mmflare.psd │ ├── 50mmflare.psd.meta │ ├── Brick.prefab │ ├── Brick.prefab.meta │ ├── Sun.flare │ ├── Sun.flare.meta │ ├── Sun.prefab │ ├── Sun.prefab.meta │ ├── brick.png │ └── brick.png.meta ├── Prefabs.meta ├── Prefabs │ ├── Splash!.prefab │ ├── Splash!.prefab.meta │ ├── WaterManager.prefab │ ├── WaterManager.prefab.meta │ ├── WaterMesh.prefab │ └── WaterMesh.prefab.meta ├── Scripts.meta ├── Scripts │ ├── Clickspawn.cs │ ├── Clickspawn.cs.meta │ ├── Water.cs │ ├── Water.cs.meta │ ├── WaterDetector.cs │ └── WaterDetector.cs.meta ├── Water textures and materials.meta ├── Water textures and materials │ ├── Water.mat │ ├── Water.mat.meta │ ├── droplet.mat │ ├── droplet.mat.meta │ ├── droplet.png │ ├── droplet.png.meta │ ├── water.png │ ├── water.png.meta │ ├── watertop.mat │ └── watertop.mat.meta ├── scene.unity └── scene.unity.meta └── demo ├── web.html └── web.unity3d /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Tuts+ 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, this 11 | list of conditions and the following disclaimer in the documentation and/or 12 | other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | unity2d-water-effect 2 | ==================== 3 | -------------------------------------------------------------------------------- /assets/For demonstration.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98ad2cadaaa9d3c408a3f925c0e0f475 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /assets/For demonstration/50mmflare.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/For demonstration/50mmflare.psd -------------------------------------------------------------------------------- /assets/For demonstration/50mmflare.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a70f6f88b2a7c60488014ce7e6e75d9a 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 1 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -3 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: 2 27 | aniso: 1 28 | mipBias: -1 29 | wrapMode: 1 30 | nPOTScale: 0 31 | lightmap: 0 32 | compressionQuality: 50 33 | spriteMode: 0 34 | spriteExtrude: 1 35 | spriteMeshType: 1 36 | alignment: 0 37 | spritePivot: {x: .5, y: .5} 38 | spritePixelsToUnits: 100 39 | alphaIsTransparency: 1 40 | textureType: 2 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /assets/For demonstration/Brick.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/For demonstration/Brick.prefab -------------------------------------------------------------------------------- /assets/For demonstration/Brick.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0f0b630dcf0d74418857e731bf17af8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/For demonstration/Sun.flare: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/For demonstration/Sun.flare -------------------------------------------------------------------------------- /assets/For demonstration/Sun.flare.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2785b9f7985fe84ca9af548964d3453 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/For demonstration/Sun.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/For demonstration/Sun.prefab -------------------------------------------------------------------------------- /assets/For demonstration/Sun.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37255ca2c4c9def469a6a15a37391260 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/For demonstration/brick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/For demonstration/brick.png -------------------------------------------------------------------------------- /assets/For demonstration/brick.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7234283808cd2a24e9729dec8748a46c 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -3 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: 2 27 | aniso: -1 28 | mipBias: -1 29 | wrapMode: -1 30 | nPOTScale: 0 31 | lightmap: 0 32 | compressionQuality: 50 33 | spriteMode: 1 34 | spriteExtrude: 1 35 | spriteMeshType: 1 36 | alignment: 0 37 | spritePivot: {x: .5, y: .5} 38 | spritePixelsToUnits: 100 39 | alphaIsTransparency: 1 40 | textureType: 8 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2893cd41b5f6ea8428f86cb1aa449d37 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /assets/Prefabs/Splash!.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Prefabs/Splash!.prefab -------------------------------------------------------------------------------- /assets/Prefabs/Splash!.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47bfa965e40c98948a14a77841013404 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/Prefabs/WaterManager.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Prefabs/WaterManager.prefab -------------------------------------------------------------------------------- /assets/Prefabs/WaterManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbda2ebfe2644284192c36b92595e6a1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/Prefabs/WaterMesh.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Prefabs/WaterMesh.prefab -------------------------------------------------------------------------------- /assets/Prefabs/WaterMesh.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd7d08261984f0f47981e1d04ab665d1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fe4bc2234d8fe04e922a03c132e4dcb 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /assets/Scripts/Clickspawn.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Clickspawn : MonoBehaviour { 5 | 6 | public GameObject Brick; 7 | 8 | void Update () { 9 | if (Input.GetMouseButtonDown(0)) 10 | { 11 | GameObject brick = Instantiate(Brick, Camera.main.ScreenToWorldPoint(Input.mousePosition + new Vector3(0,0,10)), Brick.transform.rotation) as GameObject; 12 | brick.transform.Rotate(0, 0, UnityEngine.Random.Range(0, 0)); 13 | brick.transform.localScale = new Vector3(UnityEngine.Random.Range(1f, 2f),0.6f,1)*0.4f; 14 | brick.rigidbody2D.mass = brick.transform.localScale.x * brick.transform.localScale.y*5f; 15 | Destroy(brick, 1.4f); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /assets/Scripts/Clickspawn.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56024fb471c6bf34bbcbfd14b3db4b8a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /assets/Scripts/Water.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Water : MonoBehaviour { 5 | 6 | //Our renderer that'll make the top of the water visible 7 | LineRenderer Body; 8 | 9 | //Our physics arrays 10 | float[] xpositions; 11 | float[] ypositions; 12 | float[] velocities; 13 | float[] accelerations; 14 | 15 | //Our meshes and colliders 16 | GameObject[] meshobjects; 17 | GameObject[] colliders; 18 | Mesh[] meshes; 19 | 20 | //Our particle system 21 | public GameObject splash; 22 | 23 | //The material we're using for the top of the water 24 | public Material mat; 25 | 26 | //The GameObject we're using for a mesh 27 | public GameObject watermesh; 28 | 29 | //All our constants 30 | const float springconstant = 0.02f; 31 | const float damping = 0.04f; 32 | const float spread = 0.05f; 33 | const float z = -1f; 34 | 35 | //The properties of our water 36 | float baseheight; 37 | float left; 38 | float bottom; 39 | 40 | 41 | void Start() 42 | { 43 | //Spawning our water 44 | SpawnWater(-10,20,0,-3); 45 | } 46 | 47 | 48 | public void Splash(float xpos, float velocity) 49 | { 50 | //If the position is within the bounds of the water: 51 | if (xpos >= xpositions[0] && xpos <= xpositions[xpositions.Length-1]) 52 | { 53 | //Offset the x position to be the distance from the left side 54 | xpos -= xpositions[0]; 55 | 56 | //Find which spring we're touching 57 | int index = Mathf.RoundToInt((xpositions.Length-1)*(xpos / (xpositions[xpositions.Length-1] - xpositions[0]))); 58 | 59 | //Add the velocity of the falling object to the spring 60 | velocities[index] += velocity; 61 | 62 | //Set the lifetime of the particle system. 63 | float lifetime = 0.93f + Mathf.Abs(velocity)*0.07f; 64 | 65 | //Set the splash to be between two values in Shuriken by setting it twice. 66 | splash.GetComponent().startSpeed = 8+2*Mathf.Pow(Mathf.Abs(velocity),0.5f); 67 | splash.GetComponent().startSpeed = 9 + 2 * Mathf.Pow(Mathf.Abs(velocity), 0.5f); 68 | splash.GetComponent().startLifetime = lifetime; 69 | 70 | //Set the correct position of the particle system. 71 | Vector3 position = new Vector3(xpositions[index],ypositions[index]-0.35f,5); 72 | 73 | //This line aims the splash towards the middle. Only use for small bodies of water: 74 | Quaternion rotation = Quaternion.LookRotation(new Vector3(xpositions[Mathf.FloorToInt(xpositions.Length / 2)], baseheight + 8, 5) - position); 75 | 76 | //Create the splash and tell it to destroy itself. 77 | GameObject splish = Instantiate(splash,position,rotation) as GameObject; 78 | Destroy(splish, lifetime+0.3f); 79 | } 80 | } 81 | 82 | public void SpawnWater(float Left, float Width, float Top, float Bottom) 83 | { 84 | //Bonus exercise: Add a box collider to the water that will allow things to float in it. 85 | gameObject.AddComponent(); 86 | gameObject.GetComponent().center = new Vector2(Left + Width / 2, (Top + Bottom) / 2); 87 | gameObject.GetComponent().size = new Vector2(Width, Top - Bottom); 88 | gameObject.GetComponent().isTrigger = true; 89 | 90 | 91 | //Calculating the number of edges and nodes we have 92 | int edgecount = Mathf.RoundToInt(Width) * 5; 93 | int nodecount = edgecount + 1; 94 | 95 | //Add our line renderer and set it up: 96 | Body = gameObject.AddComponent(); 97 | Body.material = mat; 98 | Body.material.renderQueue = 1000; 99 | Body.SetVertexCount(nodecount); 100 | Body.SetWidth(0.1f, 0.1f); 101 | 102 | //Declare our physics arrays 103 | xpositions = new float[nodecount]; 104 | ypositions = new float[nodecount]; 105 | velocities = new float[nodecount]; 106 | accelerations = new float[nodecount]; 107 | 108 | //Declare our mesh arrays 109 | meshobjects = new GameObject[edgecount]; 110 | meshes = new Mesh[edgecount]; 111 | colliders = new GameObject[edgecount]; 112 | 113 | //Set our variables 114 | baseheight = Top; 115 | bottom = Bottom; 116 | left = Left; 117 | 118 | //For each node, set the line renderer and our physics arrays 119 | for (int i = 0; i < nodecount; i++) 120 | { 121 | ypositions[i] = Top; 122 | xpositions[i] = Left + Width * i / edgecount; 123 | Body.SetPosition(i, new Vector3(xpositions[i], Top, z)); 124 | accelerations[i] = 0; 125 | velocities[i] = 0; 126 | } 127 | 128 | //Setting the meshes now: 129 | for (int i = 0; i < edgecount; i++) 130 | { 131 | //Make the mesh 132 | meshes[i] = new Mesh(); 133 | 134 | //Create the corners of the mesh 135 | Vector3[] Vertices = new Vector3[4]; 136 | Vertices[0] = new Vector3(xpositions[i], ypositions[i], z); 137 | Vertices[1] = new Vector3(xpositions[i + 1], ypositions[i + 1], z); 138 | Vertices[2] = new Vector3(xpositions[i], bottom, z); 139 | Vertices[3] = new Vector3(xpositions[i+1], bottom, z); 140 | 141 | //Set the UVs of the texture 142 | Vector2[] UVs = new Vector2[4]; 143 | UVs[0] = new Vector2(0, 1); 144 | UVs[1] = new Vector2(1, 1); 145 | UVs[2] = new Vector2(0, 0); 146 | UVs[3] = new Vector2(1, 0); 147 | 148 | //Set where the triangles should be. 149 | int[] tris = new int[6] { 0, 1, 3, 3, 2, 0}; 150 | 151 | //Add all this data to the mesh. 152 | meshes[i].vertices = Vertices; 153 | meshes[i].uv = UVs; 154 | meshes[i].triangles = tris; 155 | 156 | //Create a holder for the mesh, set it to be the manager's child 157 | meshobjects[i] = Instantiate(watermesh,Vector3.zero,Quaternion.identity) as GameObject; 158 | meshobjects[i].GetComponent().mesh = meshes[i]; 159 | meshobjects[i].transform.parent = transform; 160 | 161 | //Create our colliders, set them be our child 162 | colliders[i] = new GameObject(); 163 | colliders[i].name = "Trigger"; 164 | colliders[i].AddComponent(); 165 | colliders[i].transform.parent = transform; 166 | 167 | //Set the position and scale to the correct dimensions 168 | colliders[i].transform.position = new Vector3(Left + Width * (i + 0.5f) / edgecount, Top - 0.5f, 0); 169 | colliders[i].transform.localScale = new Vector3(Width / edgecount, 1, 1); 170 | 171 | //Add a WaterDetector and make sure they're triggers 172 | colliders[i].GetComponent().isTrigger = true; 173 | colliders[i].AddComponent(); 174 | 175 | } 176 | 177 | 178 | 179 | 180 | } 181 | 182 | //Same as the code from in the meshes before, set the new mesh positions 183 | void UpdateMeshes() 184 | { 185 | for (int i = 0; i < meshes.Length; i++) 186 | { 187 | 188 | Vector3[] Vertices = new Vector3[4]; 189 | Vertices[0] = new Vector3(xpositions[i], ypositions[i], z); 190 | Vertices[1] = new Vector3(xpositions[i+1], ypositions[i+1], z); 191 | Vertices[2] = new Vector3(xpositions[i], bottom, z); 192 | Vertices[3] = new Vector3(xpositions[i+1], bottom, z); 193 | 194 | meshes[i].vertices = Vertices; 195 | } 196 | } 197 | 198 | //Called regularly by Unity 199 | void FixedUpdate() 200 | { 201 | //Here we use the Euler method to handle all the physics of our springs: 202 | for (int i = 0; i < xpositions.Length ; i++) 203 | { 204 | float force = springconstant * (ypositions[i] - baseheight) + velocities[i]*damping ; 205 | accelerations[i] = -force; 206 | ypositions[i] += velocities[i]; 207 | velocities[i] += accelerations[i]; 208 | Body.SetPosition(i, new Vector3(xpositions[i], ypositions[i], z)); 209 | } 210 | 211 | //Now we store the difference in heights: 212 | float[] leftDeltas = new float[xpositions.Length]; 213 | float[] rightDeltas = new float[xpositions.Length]; 214 | 215 | //We make 8 small passes for fluidity: 216 | for (int j = 0; j < 8; j++) 217 | { 218 | for (int i = 0; i < xpositions.Length; i++) 219 | { 220 | //We check the heights of the nearby nodes, adjust velocities accordingly, record the height differences 221 | if (i > 0) 222 | { 223 | leftDeltas[i] = spread * (ypositions[i] - ypositions[i-1]); 224 | velocities[i - 1] += leftDeltas[i]; 225 | } 226 | if (i < xpositions.Length - 1) 227 | { 228 | rightDeltas[i] = spread * (ypositions[i] - ypositions[i + 1]); 229 | velocities[i + 1] += rightDeltas[i]; 230 | } 231 | } 232 | 233 | //Now we apply a difference in position 234 | for (int i = 0; i < xpositions.Length; i++) 235 | { 236 | if (i > 0) 237 | ypositions[i-1] += leftDeltas[i]; 238 | if (i < xpositions.Length - 1) 239 | ypositions[i + 1] += rightDeltas[i]; 240 | } 241 | } 242 | //Finally we update the meshes to reflect this 243 | UpdateMeshes(); 244 | } 245 | 246 | void OnTriggerStay2D(Collider2D Hit) 247 | { 248 | //Bonus exercise. Fill in your code here for making things float in your water. 249 | //You might want to even include a buoyancy constant unique to each object! 250 | } 251 | 252 | 253 | } 254 | -------------------------------------------------------------------------------- /assets/Scripts/Water.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fce86bec1fc5582428c0853b49b0ad13 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /assets/Scripts/WaterDetector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class WaterDetector : MonoBehaviour { 5 | 6 | void OnTriggerEnter2D(Collider2D Hit) 7 | { 8 | if (Hit.rigidbody2D != null) 9 | { 10 | transform.parent.GetComponent().Splash(transform.position.x, Hit.rigidbody2D.velocity.y*Hit.rigidbody2D.mass / 40f); 11 | } 12 | } 13 | 14 | /*void OnTriggerStay2D(Collider2D Hit) 15 | { 16 | //print(Hit.name); 17 | if (Hit.rigidbody2D != null) 18 | { 19 | int points = Mathf.RoundToInt(Hit.transform.localScale.x * 15f); 20 | for (int i = 0; i < points; i++) 21 | { 22 | transform.parent.GetComponent().Splish(Hit.transform.position.x - Hit.transform.localScale.x + i * 2 * Hit.transform.localScale.x / points, Hit.rigidbody2D.mass * Hit.rigidbody2D.velocity.x / 10f / points * 2f); 23 | } 24 | } 25 | }*/ 26 | 27 | } 28 | -------------------------------------------------------------------------------- /assets/Scripts/WaterDetector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0872444fddd0cb45b479751d11912ba 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /assets/Water textures and materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cd546affd3f88c4299ee11089089222 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /assets/Water textures and materials/Water.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Water textures and materials/Water.mat -------------------------------------------------------------------------------- /assets/Water textures and materials/Water.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf40bc66694cfac489565a26c7f71564 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/Water textures and materials/droplet.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Water textures and materials/droplet.mat -------------------------------------------------------------------------------- /assets/Water textures and materials/droplet.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb1ef0236dc2a954ba9055f7007ca2d1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/Water textures and materials/droplet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Water textures and materials/droplet.png -------------------------------------------------------------------------------- /assets/Water textures and materials/droplet.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cb030bbe09e1354399930f0c7cbfc20 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 0 8 | linearTexture: 1 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -3 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: -1 27 | aniso: 1 28 | mipBias: -1 29 | wrapMode: 1 30 | nPOTScale: 0 31 | lightmap: 0 32 | compressionQuality: 50 33 | spriteMode: 0 34 | spriteExtrude: 1 35 | spriteMeshType: 1 36 | alignment: 0 37 | spritePivot: {x: .5, y: .5} 38 | spritePixelsToUnits: 100 39 | alphaIsTransparency: 1 40 | textureType: 2 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /assets/Water textures and materials/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Water textures and materials/water.png -------------------------------------------------------------------------------- /assets/Water textures and materials/water.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4b478098ac84fa4d9df5b75b7638919 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 0 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .25 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -3 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: -1 27 | aniso: 1 28 | mipBias: -1 29 | wrapMode: 1 30 | nPOTScale: 1 31 | lightmap: 0 32 | compressionQuality: 50 33 | spriteMode: 0 34 | spriteExtrude: 1 35 | spriteMeshType: 1 36 | alignment: 0 37 | spritePivot: {x: .5, y: .5} 38 | spritePixelsToUnits: 100 39 | alphaIsTransparency: 0 40 | textureType: 0 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /assets/Water textures and materials/watertop.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/Water textures and materials/watertop.mat -------------------------------------------------------------------------------- /assets/Water textures and materials/watertop.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4437615c3e751844f98d32d8b462f6b8 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /assets/scene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/assets/scene.unity -------------------------------------------------------------------------------- /assets/scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 824980a6009f78b43929258e19c0e0f6 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /demo/web.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Unity Web Player | Water 6 | 7 | 15 | 63 | 118 | 119 | 120 |
121 |
122 |
123 | 124 | Unity Web Player. Install now! 125 | 126 |
127 |
128 | 129 | Unity Web Player. Install now! Restart your browser after install. 130 | 131 |
132 |
133 |
134 | 135 | 136 | -------------------------------------------------------------------------------- /demo/web.unity3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tutsplus/unity-2d-water-effect/36a8fb2a5cd9390152d986853f35d839e786359c/demo/web.unity3d --------------------------------------------------------------------------------