├── README.md ├── Assets ├── Scripts │ ├── Generator │ │ ├── OpenMode.cs │ │ ├── BlockType.cs │ │ ├── Step.cs.meta │ │ ├── BlockType.cs.meta │ │ ├── Generator.cs.meta │ │ ├── Island.cs.meta │ │ ├── OpenMode.cs.meta │ │ ├── BlockGenerator.cs.meta │ │ ├── CityGenerator.cs.meta │ │ ├── RoadGenerator.cs.meta │ │ ├── RockGenerator.cs.meta │ │ ├── SectorGenerator.cs.meta │ │ ├── TreeGenerator.cs.meta │ │ ├── BuildingGenerator.cs.meta │ │ ├── CountryGenerator.cs.meta │ │ ├── TerrainGenerator.cs.meta │ │ ├── Island.cs │ │ ├── Step.cs │ │ ├── RoadGenerator.cs │ │ ├── CountryGenerator.cs │ │ ├── RockGenerator.cs │ │ ├── SectorGenerator.cs │ │ ├── BuildingGenerator.cs │ │ ├── CityGenerator.cs │ │ ├── BlockGenerator.cs │ │ └── TreeGenerator.cs │ ├── Generator.meta │ ├── Fader.cs.meta │ ├── RotateCamera.cs.meta │ ├── WaterController.cs.meta │ ├── CameraController.cs.meta │ ├── WaterController.cs │ ├── RotateCamera.cs │ ├── Fader.cs │ └── CameraController.cs ├── Scenes │ ├── Terrain.unity.meta │ └── Tree.unity.meta ├── Editor.meta ├── Resources.meta ├── Resources │ ├── Water │ │ ├── Water4 │ │ │ ├── Sources │ │ │ │ ├── Scripts │ │ │ │ │ ├── WaterQuality.cs │ │ │ │ │ ├── GerstnerDisplace.cs │ │ │ │ │ ├── WaterBase.cs.meta │ │ │ │ │ ├── WaterTile.cs.meta │ │ │ │ │ ├── MeshContainer.cs.meta │ │ │ │ │ ├── WaterQuality.cs.meta │ │ │ │ │ ├── PlanarReflection.cs.meta │ │ │ │ │ ├── SpecularLighting.cs.meta │ │ │ │ │ ├── MeshContainer.cs │ │ │ │ │ ├── SpecularLighting.cs │ │ │ │ │ ├── Displace.cs.meta │ │ │ │ │ ├── GerstnerDisplace.cs.meta │ │ │ │ │ ├── Displace.cs │ │ │ │ │ ├── WaterTile.cs │ │ │ │ │ ├── WaterBase.cs │ │ │ │ │ └── PlanarReflection.cs │ │ │ │ ├── Objects.meta │ │ │ │ ├── Objects │ │ │ │ │ ├── ocean_plane.FBX │ │ │ │ │ ├── ocean_plane.mat.meta │ │ │ │ │ ├── Materials.meta │ │ │ │ │ ├── Materials │ │ │ │ │ │ ├── ocean_plane-No Name.mat.meta │ │ │ │ │ │ └── ocean_plane-No Name.mat │ │ │ │ │ ├── ocean_plane.mat │ │ │ │ │ └── ocean_plane.FBX.meta │ │ │ │ ├── Scripts.meta │ │ │ │ ├── Shaders.meta │ │ │ │ ├── Textures.meta │ │ │ │ ├── Textures │ │ │ │ │ ├── SimpleFoam.png │ │ │ │ │ ├── smallWavesMap.png │ │ │ │ │ ├── SimpleFoam.png.meta │ │ │ │ │ └── smallWavesMap.png.meta │ │ │ │ ├── Materials.meta │ │ │ │ ├── Materials │ │ │ │ │ ├── Water4Example.mat.meta │ │ │ │ │ ├── Water4ExampleSimple.mat.meta │ │ │ │ │ └── Water4ExampleSimple.mat │ │ │ │ └── Shaders │ │ │ │ │ ├── FX-Water4.shader.meta │ │ │ │ │ ├── WaterInclude.cginc.meta │ │ │ │ │ ├── FX-SimpleWater4.shader.meta │ │ │ │ │ └── WaterInclude.cginc │ │ │ └── Sources.meta │ │ ├── Daylight Water.prefab.meta │ │ ├── Sources.meta │ │ ├── Sources │ │ │ ├── Objects │ │ │ │ ├── Water Plane.fbx │ │ │ │ ├── Materials.meta │ │ │ │ ├── Materials │ │ │ │ │ ├── water plane-lambert1.mat.meta │ │ │ │ │ └── water plane-lambert1.mat │ │ │ │ └── Water Plane.fbx.meta │ │ │ ├── Textures │ │ │ │ ├── Waterbump.jpg │ │ │ │ ├── Water Fresnel.psd │ │ │ │ ├── oceangradient.psd │ │ │ │ ├── Water fallback.jpg │ │ │ │ ├── oceangradientcube.psd │ │ │ │ ├── Water Fresnel.psd.meta │ │ │ │ ├── Water fallback.jpg.meta │ │ │ │ ├── Waterbump.jpg.meta │ │ │ │ ├── oceangradient.psd.meta │ │ │ │ └── oceangradientcube.psd.meta │ │ │ ├── Materials.meta │ │ │ ├── Objects.meta │ │ │ ├── Scripts.meta │ │ │ ├── Shaders.meta │ │ │ ├── Textures.meta │ │ │ ├── Materials │ │ │ │ ├── Daylight Water.mat.meta │ │ │ │ └── Daylight Water.mat │ │ │ ├── Shaders │ │ │ │ ├── FX-Water.shader.meta │ │ │ │ └── FX-Water.shader │ │ │ └── Scripts │ │ │ │ └── Water.cs.meta │ │ ├── Water4.meta │ │ └── Daylight Water.prefab │ ├── Materials │ │ ├── Rock.mat.meta │ │ ├── TreeBark.mat.meta │ │ ├── TreeFolliage.mat.meta │ │ ├── TreeBark.mat │ │ ├── TreeFolliage.mat │ │ └── Rock.mat │ ├── Prefabs │ │ ├── Sun.prefab.meta │ │ ├── Backlight.prefab.meta │ │ ├── Backlight.prefab │ │ └── Sun.prefab │ ├── Light Flares │ │ ├── Sun.flare.meta │ │ ├── 50mm Zoom.flare.meta │ │ ├── Small Flare.flare.meta │ │ ├── Sources.meta │ │ ├── Sources │ │ │ ├── Textures │ │ │ │ ├── 50mmflare.psd │ │ │ │ ├── starflare.psd │ │ │ │ ├── 50mmflare.psd.meta │ │ │ │ └── starflare.psd.meta │ │ │ ├── Materials │ │ │ │ ├── flare mat.mat.meta │ │ │ │ └── flare mat.mat │ │ │ ├── Textures.meta │ │ │ └── Materials.meta │ │ ├── Small Flare.flare │ │ ├── Sun.flare │ │ └── 50mm Zoom.flare │ ├── Materials.meta │ ├── Prefabs.meta │ ├── Skyboxes.meta │ ├── Water.meta │ ├── Light Flares.meta │ └── Skyboxes │ │ ├── DawnDusk Skybox.mat.meta │ │ ├── Textures.meta │ │ ├── Textures │ │ ├── DawnDusk │ │ │ ├── DawnDusk_up.tif │ │ │ ├── DawnDusk_back.tif │ │ │ ├── DawnDusk_down.tif │ │ │ ├── DawnDusk_front.tif │ │ │ ├── DawnDusk_left.tif │ │ │ ├── DawnDusk_right.tif │ │ │ ├── DawnDusk_up.tif.meta │ │ │ ├── DawnDusk_back.tif.meta │ │ │ ├── DawnDusk_down.tif.meta │ │ │ ├── DawnDusk_front.tif.meta │ │ │ ├── DawnDusk_left.tif.meta │ │ │ └── DawnDusk_right.tif.meta │ │ └── DawnDusk.meta │ │ └── DawnDusk Skybox.mat ├── Scenes.meta ├── Scripts.meta └── Editor │ ├── Water (Pro Only).meta │ └── Water (Pro Only) │ ├── Water4.meta │ └── Water4 │ ├── WaterBaseEditor.cs.meta │ ├── GerstnerDisplaceEditor.cs.meta │ ├── PlanarReflectionEditor.cs.meta │ ├── SpecularLightingEditor.cs.meta │ ├── WaterEditorUtility.cs.meta │ ├── SpecularLightingEditor.cs │ ├── PlanarReflectionEditor.cs │ ├── WaterEditorUtility.cs │ ├── GerstnerDisplaceEditor.cs │ └── WaterBaseEditor.cs ├── ProjectSettings ├── NetworkManager.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── AudioManager.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── DynamicsManager.asset ├── TagManager.asset ├── Physics2DSettings.asset ├── NavMeshLayers.asset ├── QualitySettings.asset ├── InputManager.asset └── ProjectSettings.asset ├── .gitignore └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # unity3d-pcg 2 | PCG Tools for Unity3D 3 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/OpenMode.cs: -------------------------------------------------------------------------------- 1 | public enum OpenMode { 2 | BFS, 3 | DFS, 4 | IDS, 5 | } -------------------------------------------------------------------------------- /Assets/Scenes/Terrain.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ea2034e4e95b0a4291bd482548c82eb 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Scenes/Tree.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f93c1be9b0797674b827c1bc58affc6f 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4edfa84f6fc8b2d428da4b7b13610da7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a80fef0718a3a9d448b5459abb937a38 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterQuality.cs: -------------------------------------------------------------------------------- 1 | public enum WaterQuality { 2 | High = 2, 3 | Medium = 1, 4 | Low = 0, 5 | } -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0922d14d10cd344d9557d3d623fb281 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c0a8431f375aa74ca9f783ab5cedd46 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Materials/Rock.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7aa10feff57a444d98de1aed5763e66 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Prefabs/Sun.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e49641d092fa7ea44b7791af1a185e80 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sun.flare.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09ebe82dbd1113c3d000dc0b8d76c639 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f0b4a0601da6cd4d8bb044ad649009c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Materials/TreeBark.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c19264f25bf3d904b9db7cc60698fe24 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d71c69c8d404cb54b9058ad6d986f8f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Prefabs/Backlight.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ed93a345d3c18d46870fbaf37ba4a22 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 607426a9820414bfd8081fb22854dbd4 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15577174a872740edb59495b6549a0c3 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adbcdd7439d8fe2468efa8c0b5809b18 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only).meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d46fb69d77d9fa4ebf512bcd4ff6dc8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8cfa4746d26d4715b9f848bce1e2f14 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/50mm Zoom.flare.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 54fbbf098d116effa00081aba8ad6659 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Small Flare.flare.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9bdb18c49d114cb4300035184241aa39 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Materials/TreeFolliage.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56d1c82fc4c52aa48bb03841a7d92683 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/DawnDusk Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ba05f538ee36044da5cd2a4f14a8b18 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Daylight Water.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 780611a67e8e941a2b3aa96e5915a793 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32569ca6b14e24176be40165ccaa300c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects/Water Plane.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Objects/Water Plane.fbx -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/Waterbump.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Textures/Waterbump.jpg -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17e234879cb994b7f93d7437c10d23d6 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ef50104b12ed4ca9bed40f105986cd7 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/Water Fresnel.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Textures/Water Fresnel.psd -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/oceangradient.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Textures/oceangradient.psd -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66207ff69de6b4d73a445036c3a195f6 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97593109f34de48109618fb5687a88b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Textures/50mmflare.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Light Flares/Sources/Textures/50mmflare.psd -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Textures/starflare.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Light Flares/Sources/Textures/starflare.psd -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_up.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_up.tif -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8269a010592f549af8f11b1683d9e794 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe5d00245bc1d42a7927f4b2879026b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5b8c0f9acc2944f086c02cb83f4ae76 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e70b47c0cfc1d4b12a3c663d7582a523 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c22094bc116524b2a95c9aae09278b22 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/Water fallback.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Textures/Water fallback.jpg -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7097f369c5ba74821bd76c430889322a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Materials/flare mat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6dbb96b9d112024d000e929e39e7c39 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a0517c8f07c047f2965315b8dac81aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: daf8ab28ea6df4773bf38cb9e3e173e1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_back.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_back.tif -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_down.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_down.tif -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_front.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_front.tif -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_left.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_left.tif -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_right.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_right.tif -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Materials/Daylight Water.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae162c0523ab4468bb03ef160eb672e2 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/oceangradientcube.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Sources/Textures/oceangradientcube.psd -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6aa58ee2f84094af2846e1a7bb0c23f9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/ocean_plane.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Water4/Sources/Objects/ocean_plane.FBX -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/ocean_plane.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80dc0f296ac9946ca8fe9c4259b1b229 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bbbb1d2bfc4f43f79f3226bca2d1f64 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c538784885b34a5987ed9f6651d9ecd 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cc8ac37e0da341db819af6143a07b03 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Textures/SimpleFoam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Water4/Sources/Textures/SimpleFoam.png -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BlockType.cs: -------------------------------------------------------------------------------- 1 | public enum BlockType { 2 | Office, 3 | Residential, 4 | Comercial, 5 | Industrial, 6 | Facility, 7 | Park, 8 | } -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ca8e16c3e0ab45e69aef7738ef77d3a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e68e75546e8d4feab8846bfaf8878d3 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a771af3b1958445078af5fe2e9ec726c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Materials/Water4Example.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e1467e748fa74c64b96759b3d9713ae 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Textures/smallWavesMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apiad/unity3d-pcg/HEAD/Assets/Resources/Water/Water4/Sources/Textures/smallWavesMap.png -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Materials/Water4ExampleSimple.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 656fde119942645aa8e062e04c119aa1 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3033e46ab6c9e44a9b9dd0e9f5130357 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects/Materials/water plane-lambert1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 358a87f082de94ddd810e929c00c8594 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Shaders/FX-Water.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cac2e0bcc34e4b3cbb4bd85982eba83 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eae94293b93a5474d8b82710736a6022 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Shaders/FX-Water4.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 475c4a4e617a8401b84ca7b32c7cc460 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Shaders/WaterInclude.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34e1452e07a0b40c295c5b10aa679465 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Shaders/FX-SimpleWater4.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8aaff0751054e4a9cb4642d01eaf5be9 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/GerstnerDisplace.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [ExecuteInEditMode] 4 | [RequireComponent(typeof(WaterBase))] 5 | 6 | public class GerstnerDisplace : Displace 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /Assets/Scripts/Fader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdadcbafa9ebfdb4c82dd5a16201825b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/Step.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9757a5fb01eafaf418c6396a525cd779 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/RotateCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9c2c1f47bfcf6e499167f9cbec4e89f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/WaterController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a0779315115537408664f09621cc295 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/CameraController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d4bd6f553f63fd409f0e345c879786a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BlockType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 640f64738b5ede44daac564f19d9efee 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/Generator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56347b15b26261347ab5c31376b9190f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/Island.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1cd7a3341a2fcf4196f1e03f9ad2a81 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/OpenMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a155525570771b942a69ef5224ac68a6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BlockGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ec7d9927ce40ce45a4ff1bfc57802fe 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/CityGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5489ab728d4547646910d8735a2582cf 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/RoadGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60fe2851f37b40047b67bc8ebf6c3440 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/RockGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4115b95c6ce94d4c8e48eae9b7df2ae 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/SectorGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf9f596813d0d554cb49345204fedbe1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/TreeGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bda17b67747065c4e9c84d39bf579ba6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Scripts/Water.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3d3ef1a5bbfb4e0a910fbbe5830b1f9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BuildingGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0383dcd2a7bc29641b2acc63b53d7bb4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/CountryGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c0185d86804df64aa83a33e63afaf36 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/TerrainGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 508966cc2354ebc41af5b106acbca493 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c2c627f6fe3945b39581fc103d32251 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1da353243062479a9b31c85074a796b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterTile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a91e8dd37cdd41efb4859b65aced7a2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dfa22e5547fb4a4585ba225887d89dd 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff3b0e14a61014f50be83e1a18c6d43e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33f51eb21122c4ca6a199d561065ae30 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f67f2bac30f824d4f8270bb8bb0779df 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/MeshContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 951d74f7d57bed84cb623c62436bd064 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterQuality.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82d8c09130092e2448e7870798551fe8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/Terrain.unity 10 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/PlanarReflection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4185bc77c7194462ca3b1097ef4a5de0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/SpecularLighting.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de2ab2b9ac93bb544b9552e49030371b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/Island.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class Island { 4 | public Island(Vector3 center, float radius) { 5 | this.Center = center; 6 | this.Radius = radius; 7 | } 8 | 9 | public Vector3 Center { get; set; } 10 | public float Radius { get; set; } 11 | } -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | m_SpeedOfSound: 347 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_DSPBufferSize: 0 12 | m_DisableAudio: 0 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/Step.cs: -------------------------------------------------------------------------------- 1 | public struct Step where T : class { 2 | public float Wait { get; private set; } 3 | 4 | public T Item { get; private set; } 5 | 6 | public Step(T item) 7 | : this() { 8 | Item = item; 9 | } 10 | 11 | public Step(float wait):this() { 12 | Wait = wait; 13 | } 14 | 15 | public bool HasItem { get { return Item != null; } } 16 | } -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 0 12 | m_SpritePackerMode: 0 13 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/MeshContainer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class MeshContainer 4 | { 5 | public Mesh mesh; 6 | public Vector3[] vertices; 7 | public Vector3[] normals; 8 | 9 | public MeshContainer(Mesh m) { 10 | mesh = m; 11 | vertices = m.vertices; 12 | normals = m.normals; 13 | } 14 | 15 | public void Update() { 16 | mesh.vertices = vertices; 17 | mesh.normals = normals; 18 | } 19 | } -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_AlwaysIncludedShaders: 8 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 9 | - {fileID: 30, guid: 0000000000000000f000000000000000, type: 0} 10 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 11 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 12 | -------------------------------------------------------------------------------- /Assets/Scripts/WaterController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class WaterController : MonoBehaviour { 5 | 6 | // Use this for initialization 7 | void Start () { 8 | 9 | } 10 | 11 | // Update is called once per frame 12 | void Update () { 13 | if (Input.GetKey(KeyCode.I)) { 14 | this.transform.Translate(Vector3.up * 10 * Time.deltaTime); 15 | } 16 | else if (Input.GetKey(KeyCode.K)) { 17 | this.transform.Translate(Vector3.down * 10 * Time.deltaTime); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/SpecularLighting.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [RequireComponent(typeof(WaterBase))] 4 | [ExecuteInEditMode] 5 | public class SpecularLighting : MonoBehaviour 6 | { 7 | public Transform specularLight; 8 | private WaterBase waterBase = null; 9 | 10 | public void Start () 11 | { 12 | waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase)); 13 | } 14 | 15 | public void Update () 16 | { 17 | if (!waterBase) 18 | waterBase = (WaterBase)gameObject.GetComponent(typeof(WaterBase)); 19 | 20 | if (specularLight && waterBase.sharedMaterial) 21 | waterBase.sharedMaterial.SetVector("_WorldLightDir", specularLight.transform.forward); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepVelocity: .150000006 10 | m_SleepAngularVelocity: .140000001 11 | m_MaxAngularVelocity: 7 12 | m_MinPenetrationForPenalty: .00999999978 13 | m_SolverIterationCount: 6 14 | m_RaycastsHitTriggers: 1 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/Displace.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c62b7d87755b447919138e67f8e22e0c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - displacement2D: {fileID: 2800000, guid: 478fe261b62ca4bd99fb0a88e3bdb7ef, type: 2} 7 | - secondDisplacement2D: {fileID: 2800000, guid: 64cfb2c11a69743638efec3e7f2d370f, 8 | type: 2} 9 | - thirdDisplacement2D: {fileID: 2800000, guid: 9a40d060f6add4542958ee8e54c8f88b, 10 | type: 2} 11 | - firstCompressed: {fileID: 2800000, guid: a782b26d6436b48d9882906b9f8ca31a, type: 2} 12 | - secondCompressed: {fileID: 2800000, guid: 4facc21e08e3a43ed97c930f7dae6e7b, type: 2} 13 | - thirdCompressed: {fileID: 2800000, guid: dc30b984e8e3c4cdfb38d5fceb411602, type: 2} 14 | executionOrder: 0 15 | icon: {instanceID: 0} 16 | userData: 17 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/GerstnerDisplace.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42e7f46d0e5a84171a3909479c1646ba 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - displacement2D: {fileID: 2800000, guid: 478fe261b62ca4bd99fb0a88e3bdb7ef, type: 2} 7 | - secondDisplacement2D: {fileID: 2800000, guid: 64cfb2c11a69743638efec3e7f2d370f, 8 | type: 2} 9 | - thirdDisplacement2D: {fileID: 2800000, guid: 9a40d060f6add4542958ee8e54c8f88b, 10 | type: 2} 11 | - firstCompressed: {fileID: 2800000, guid: a782b26d6436b48d9882906b9f8ca31a, type: 2} 12 | - secondCompressed: {fileID: 2800000, guid: 4facc21e08e3a43ed97c930f7dae6e7b, type: 2} 13 | - thirdCompressed: {fileID: 2800000, guid: dc30b984e8e3c4cdfb38d5fceb411602, type: 2} 14 | executionOrder: 0 15 | icon: {instanceID: 0} 16 | userData: 17 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Materials/flare mat.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: flare mat 10 | m_Shader: {fileID: 101, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 23a02ac18d11c9ffa0009c58a8ad6659, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: {} 25 | --- !u!1002 &2100001 26 | EditorExtensionImpl: 27 | serializedVersion: 6 28 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Small Flare.flare: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!121 &12100000 4 | Flare: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Small Flare 9 | m_FlareTexture: {fileID: 2800000, guid: 51dc82ef9d11c594d000e7c9e39e7c39, type: 3} 10 | m_TextureLayout: 0 11 | m_Elements: 12 | - m_ImageIndex: 0 13 | m_Position: 0 14 | m_Size: 10 15 | m_Color: {r: 1, g: 1, b: 1, a: 0} 16 | m_UseLightColor: 1 17 | m_Rotate: 0 18 | m_Zoom: 0 19 | m_Fade: 1 20 | - m_ImageIndex: 2 21 | m_Position: 0 22 | m_Size: 40 23 | m_Color: {r: .248752579, g: .248752579, b: .248752579, a: 0} 24 | m_UseLightColor: 1 25 | m_Rotate: 0 26 | m_Zoom: 0 27 | m_Fade: 1 28 | m_UseFog: 1 29 | --- !u!1002 &12100001 30 | EditorExtensionImpl: 31 | serializedVersion: 6 32 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/Displace.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [ExecuteInEditMode] 4 | [RequireComponent(typeof(WaterBase))] 5 | 6 | public class Displace : MonoBehaviour 7 | { 8 | public void Awake() 9 | { 10 | if (enabled) 11 | OnEnable(); 12 | else 13 | OnDisable(); 14 | } 15 | 16 | public void OnEnable() 17 | { 18 | Shader.EnableKeyword("WATER_VERTEX_DISPLACEMENT_ON"); 19 | Shader.DisableKeyword("WATER_VERTEX_DISPLACEMENT_OFF"); 20 | } 21 | 22 | public void OnDisable() 23 | { 24 | Shader.EnableKeyword("WATER_VERTEX_DISPLACEMENT_OFF"); 25 | Shader.DisableKeyword("WATER_VERTEX_DISPLACEMENT_ON"); 26 | } 27 | 28 | /* 29 | public float GetOffsetAt(Vector3 pos, int displacementMapAmounts = 3) 30 | { 31 | return 0.0f; 32 | } 33 | 34 | public Vector3 GetNormalAt(Vector3 pos, float scale = 1.0F) 35 | { 36 | return Vector3.one; 37 | } 38 | */ 39 | } -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/ocean_plane.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ocean_plane 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 1, g: 1, b: 1, a: 1} 29 | --- !u!1002 &2100001 30 | EditorExtensionImpl: 31 | serializedVersion: 6 32 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects/Materials/water plane-lambert1.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: water plane-lambert1 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: .5, g: .5, b: .5, a: 1} 29 | --- !u!1002 &2100001 30 | EditorExtensionImpl: 31 | serializedVersion: 6 32 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/Materials/ocean_plane-No Name.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ocean_plane-No Name 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: 25 | data: 26 | first: 27 | name: _Color 28 | second: {r: 1, g: 1, b: 1, a: 1} 29 | --- !u!1002 &2100001 30 | EditorExtensionImpl: 31 | serializedVersion: 6 32 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/RoadGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RoadGenerator : Generator { 5 | /* private Vector3 origin; 6 | private Vector3 destination; 7 | private GameObject go; 8 | 9 | public RoadGenerator(int seed, Vector3 origin, Vector3 destination) : base(seed) { 10 | this.origin = origin; 11 | this.destination = destination; 12 | } 13 | 14 | protected override void OpenSelf() { 15 | Vector3 v = destination - origin; 16 | float l = v.magnitude; 17 | 18 | this.go = GameObject.CreatePrimitive(PrimitiveType.Cube); 19 | this.go.transform.localScale = new Vector3(Mathf.Max(2, l/100), 1, l); 20 | this.go.transform.position = origin; 21 | this.go.transform.rotation = Quaternion.LookRotation(v); 22 | this.go.transform.position += v/2; 23 | // this.go.renderer.material = RoadMaterial; 24 | } 25 | 26 | protected override void Close() { 27 | GameObject.Destroy(this.go); 28 | } 29 | */ 30 | } 31 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | tags: 6 | - 7 | Builtin Layer 0: Default 8 | Builtin Layer 1: TransparentFX 9 | Builtin Layer 2: Ignore Raycast 10 | Builtin Layer 3: 11 | Builtin Layer 4: Water 12 | Builtin Layer 5: UI 13 | Builtin Layer 6: 14 | Builtin Layer 7: 15 | User Layer 8: 16 | User Layer 9: 17 | User Layer 10: 18 | User Layer 11: 19 | User Layer 12: 20 | User Layer 13: 21 | User Layer 14: 22 | User Layer 15: 23 | User Layer 16: 24 | User Layer 17: 25 | User Layer 18: 26 | User Layer 19: 27 | User Layer 20: 28 | User Layer 21: 29 | User Layer 22: 30 | User Layer 23: 31 | User Layer 24: 32 | User Layer 25: 33 | User Layer 26: 34 | User Layer 27: 35 | User Layer 28: 36 | User Layer 29: 37 | User Layer 30: 38 | User Layer 31: 39 | m_SortingLayers: 40 | - name: Default 41 | userID: 0 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_VelocityThreshold: 1 11 | m_MaxLinearCorrection: .200000003 12 | m_MaxAngularCorrection: 8 13 | m_MaxTranslationSpeed: 100 14 | m_MaxRotationSpeed: 360 15 | m_MinPenetrationForPenalty: .00999999978 16 | m_BaumgarteScale: .200000003 17 | m_BaumgarteTimeOfImpactScale: .75 18 | m_TimeToSleep: .5 19 | m_LinearSleepTolerance: .00999999978 20 | m_AngularSleepTolerance: 2 21 | m_RaycastsHitTriggers: 1 22 | m_RaycastsStartInColliders: 1 23 | m_ChangeStopsCallbacks: 0 24 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | Temp/ 5 | Obj/ 6 | UnityGenerated/ 7 | Library/ 8 | 9 | # =============== # 10 | # Build Place # 11 | # =============== # 12 | Builds/ 13 | Assets/Experimental/ 14 | Screenshots/ 15 | 16 | # ===================================== # 17 | # Visual Studio / MonoDevelop generated # 18 | # ===================================== # 19 | ExportedObj/ 20 | *.svd 21 | *.userprefs 22 | *.csproj 23 | *.pidb 24 | *.suo 25 | *.sln 26 | *.user 27 | *.unityproj 28 | *.booproj 29 | UnityVS* 30 | 31 | # ===================================== # 32 | # Other development stuff # 33 | # ===================================== # 34 | *.user 35 | *.pdb 36 | *.aps 37 | *.pch 38 | *.vspscc 39 | *_i.c 40 | *_p.c 41 | *.ncb 42 | *.suo 43 | *.bak 44 | *.cache 45 | *.ilk 46 | *.log 47 | [Bb]in 48 | [Dd]ebug*/ 49 | *.sbr 50 | obj/ 51 | [Rr]elease*/ 52 | _ReSharper*/ 53 | 54 | # ============ # 55 | # OS generated # 56 | # ============ # 57 | .DS_Store 58 | .DS_Store? 59 | ._* 60 | .Spotlight-V100 61 | .Trashes 62 | Icon? 63 | ehthumbs.db 64 | Thumbs.db 65 | test_Data/ 66 | *.DotSettings 67 | 68 | -------------------------------------------------------------------------------- /Assets/Resources/Materials/TreeBark.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: TreeBark 10 | m_Shader: {fileID: 2, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3} 21 | m_Scale: {x: 1, y: 2} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3} 28 | m_Scale: {x: 1, y: 2} 29 | m_Offset: {x: 0, y: 0} 30 | m_Floats: {} 31 | m_Colors: 32 | data: 33 | first: 34 | name: _Color 35 | second: {r: .411764681, g: .303806216, b: .175605521, a: 1} 36 | -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_up.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6de6086ecd5fe84699b0bc7e00608a4 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Water/Sources/Textures/Water Fresnel.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b5c5575fd4c74abd9f7b30862fb76a3 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: 2 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: 1 24 | maxTextureSize: 1024 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 29 | wrapMode: 0 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: 0 40 | textureType: -1 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/Water fallback.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6f8288974c664a309d6c66de636978c 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: 2 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 29 | wrapMode: 0 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/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_back.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe48ca40e9be666419e7d1a4bf3d808a 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_down.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d2a2ce9c718dc24dae3b1ee427b27ee 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_front.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0568ecdd797316641b0203860b3929d9 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_left.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9785a5533d9270849a276a4bfbfa9418 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Skyboxes/Textures/DawnDusk/DawnDusk_right.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dda5f499bc82c442aab32e4a6bdbe40 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: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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/Resources/Water/Sources/Textures/Waterbump.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dd3788f8589b40bf82a92d76ffc5091 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 1 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 2 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 1 16 | externalNormalMap: 1 17 | heightScale: .0164516103 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 3 28 | mipBias: 0 29 | wrapMode: 0 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: 1 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/oceangradient.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17680dc3bf8f74b498b01cf1481e2593 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: 2 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .100000001 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -1 24 | maxTextureSize: 32 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alejandro Piad 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sources/Textures/50mmflare.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23a02ac18d11c9ffa0009c58a8ad6659 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: 2 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .100000001 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -1 24 | maxTextureSize: 512 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 29 | wrapMode: 0 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/Resources/Light Flares/Sources/Textures/starflare.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51dc82ef9d11c594d000e7c9e39e7c39 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: 2 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 0 16 | externalNormalMap: 0 17 | heightScale: .100000001 18 | normalMapFilter: 0 19 | isReadable: 0 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -1 24 | maxTextureSize: 256 25 | textureSettings: 26 | filterMode: 1 27 | aniso: 1 28 | mipBias: 0 29 | wrapMode: 0 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/Resources/Water/Water4/Sources/Textures/SimpleFoam.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36dd0b22da8874ed38075789055ca664 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: -1 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: -1 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Textures/smallWavesMap.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb6566c21f717904f83743a5a76dd0b0 3 | TextureImporter: 4 | serializedVersion: 2 5 | mipmaps: 6 | mipMapMode: 0 7 | enableMipMap: 1 8 | linearTexture: 1 9 | correctGamma: 0 10 | fadeOut: 0 11 | borderMipMap: 0 12 | mipMapFadeDistanceStart: 1 13 | mipMapFadeDistanceEnd: 3 14 | bumpmap: 15 | convertToNormalMap: 1 16 | externalNormalMap: 1 17 | heightScale: .131052643 18 | normalMapFilter: 1 19 | isReadable: 1 20 | grayScaleToAlpha: 0 21 | generateCubemap: 0 22 | seamlessCubemap: 0 23 | textureFormat: -1 24 | maxTextureSize: 256 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: 1 41 | buildTargetSettings: [] 42 | spriteSheet: 43 | sprites: [] 44 | spritePackingTag: 45 | userData: 46 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterTile.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [ExecuteInEditMode] 4 | public class WaterTile : MonoBehaviour 5 | { 6 | public PlanarReflection reflection; 7 | public WaterBase waterBase; 8 | 9 | public void Start () 10 | { 11 | AcquireComponents(); 12 | } 13 | 14 | private void AcquireComponents() 15 | { 16 | if (!reflection) { 17 | if (transform.parent) 18 | reflection = (PlanarReflection)transform.parent.GetComponent(); 19 | else 20 | reflection = (PlanarReflection)transform.GetComponent(); 21 | } 22 | 23 | if (!waterBase) { 24 | if (transform.parent) 25 | waterBase = (WaterBase)transform.parent.GetComponent(); 26 | else 27 | waterBase = (WaterBase)transform.GetComponent(); 28 | } 29 | } 30 | 31 | #if UNITY_EDITOR 32 | public void Update () 33 | { 34 | AcquireComponents(); 35 | } 36 | #endif 37 | 38 | public void OnWillRenderObject() 39 | { 40 | if (reflection) 41 | reflection.WaterTileBeingRendered(transform, Camera.current); 42 | if (waterBase) 43 | waterBase.WaterTileBeingRendered(transform, Camera.current); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Resources/Materials/TreeFolliage.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: TreeFolliage 10 | m_Shader: {fileID: 52, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: -0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | m_Floats: 31 | data: 32 | first: 33 | name: _Cutoff 34 | second: .5 35 | m_Colors: 36 | data: 37 | first: 38 | name: _Color 39 | second: {r: .123502977, g: .524887681, b: 0, a: 1} 40 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/CountryGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class CountryGenerator : Generator { 6 | public float Size = 50000; 7 | public float Density = 0.2f; 8 | public float Sparsness = 0.1f; 9 | public int Regions = 10; 10 | 11 | protected override IEnumerable> Open() { 12 | var plane = GameObject.CreatePrimitive(PrimitiveType.Plane); 13 | plane.transform.localScale = new Vector3(100000, 0, 100000); 14 | 15 | yield return new Step(plane); 16 | } 17 | 18 | protected override IEnumerable> GenerateChildren() { 19 | for(int i=0; i(); 23 | continue; 24 | } 25 | 26 | float x = i * Size + RandomUniform(0, Size - 20000f) - Size * Regions / 2; 27 | float z = j * Size + RandomUniform(0, Size - 20000f) - Size * Regions / 2; 28 | 29 | var city = CreateChildren("City"); 30 | city.transform.localPosition = new Vector3(x, 0, z); 31 | 32 | yield return new Step(city); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Textures/oceangradientcube.psd.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9cda328e4b6954d70841a8a66f42ec08 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 8900000: generatedCubemap 6 | serializedVersion: 2 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | linearTexture: 0 11 | correctGamma: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapFadeDistanceStart: 2 15 | mipMapFadeDistanceEnd: 3 16 | bumpmap: 17 | convertToNormalMap: 0 18 | externalNormalMap: 0 19 | heightScale: .100000001 20 | normalMapFilter: 0 21 | isReadable: 0 22 | grayScaleToAlpha: 0 23 | generateCubemap: 3 24 | seamlessCubemap: 0 25 | textureFormat: 12 26 | maxTextureSize: 32 27 | textureSettings: 28 | filterMode: 1 29 | aniso: 1 30 | mipBias: 0 31 | wrapMode: 0 32 | nPOTScale: 0 33 | lightmap: 0 34 | compressionQuality: 50 35 | spriteMode: 0 36 | spriteExtrude: 1 37 | spriteMeshType: 1 38 | alignment: 0 39 | spritePivot: {x: .5, y: .5} 40 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 41 | spritePixelsToUnits: 100 42 | alphaIsTransparency: 0 43 | textureType: -1 44 | buildTargetSettings: [] 45 | spriteSheet: 46 | sprites: [] 47 | spritePackingTag: 48 | userData: 49 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/Sun.flare: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!121 &12100000 4 | Flare: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Sun 9 | m_FlareTexture: {fileID: 2800000, guid: 23a02ac18d11c9ffa0009c58a8ad6659, type: 3} 10 | m_TextureLayout: 1 11 | m_Elements: 12 | - m_ImageIndex: 9 13 | m_Position: 0 14 | m_Size: 50 15 | m_Color: {r: 1, g: 1, b: 1, a: 1} 16 | m_UseLightColor: 1 17 | m_Rotate: 0 18 | m_Zoom: 1 19 | m_Fade: 1 20 | - m_ImageIndex: 0 21 | m_Position: 0 22 | m_Size: 50 23 | m_Color: {r: .0941176489, g: .0941176489, b: .0941176489, a: 1} 24 | m_UseLightColor: 1 25 | m_Rotate: 1 26 | m_Zoom: 1 27 | m_Fade: 1 28 | - m_ImageIndex: 5 29 | m_Position: 0 30 | m_Size: 20 31 | m_Color: {r: .0313725509, g: .0196078438, b: .0196078438, a: 1} 32 | m_UseLightColor: 1 33 | m_Rotate: 0 34 | m_Zoom: 0 35 | m_Fade: 1 36 | - m_ImageIndex: 3 37 | m_Position: 0 38 | m_Size: 10.2500019 39 | m_Color: {r: .447058827, g: 0, b: .00784313772, a: 1} 40 | m_UseLightColor: 1 41 | m_Rotate: 0 42 | m_Zoom: 0 43 | m_Fade: 1 44 | m_UseFog: 1 45 | --- !u!1002 &12100001 46 | EditorExtensionImpl: 47 | serializedVersion: 6 48 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/WaterBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | [ExecuteInEditMode] 4 | public class WaterBase : MonoBehaviour 5 | { 6 | public Material sharedMaterial; 7 | public WaterQuality waterQuality = WaterQuality.High; 8 | public bool edgeBlend = true; 9 | 10 | public void UpdateShader() 11 | { 12 | if(waterQuality > WaterQuality.Medium) 13 | sharedMaterial.shader.maximumLOD = 501; 14 | else if(waterQuality> WaterQuality.Low) 15 | sharedMaterial.shader.maximumLOD = 301; 16 | else 17 | sharedMaterial.shader.maximumLOD = 201; 18 | 19 | // If the system does not support depth textures (ie. NaCl), turn off edge bleeding, 20 | // as the shader will render everything as transparent if the depth texture is not valid. 21 | if (!SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) 22 | edgeBlend = false; 23 | 24 | if(edgeBlend) 25 | { 26 | Shader.EnableKeyword("WATER_EDGEBLEND_ON"); 27 | Shader.DisableKeyword("WATER_EDGEBLEND_OFF"); 28 | // just to make sure (some peeps might forget to add a water tile to the patches) 29 | if (Camera.main) 30 | Camera.main.depthTextureMode |= DepthTextureMode.Depth; 31 | } 32 | else 33 | { 34 | Shader.EnableKeyword("WATER_EDGEBLEND_OFF"); 35 | Shader.DisableKeyword("WATER_EDGEBLEND_ON"); 36 | } 37 | } 38 | 39 | public void WaterTileBeingRendered (Transform tr, Camera currentCam) 40 | { 41 | if (currentCam && edgeBlend) 42 | currentCam.depthTextureMode |= DepthTextureMode.Depth; 43 | } 44 | 45 | public void Update () 46 | { 47 | if(sharedMaterial) 48 | UpdateShader(); 49 | } 50 | } -------------------------------------------------------------------------------- /Assets/Resources/Materials/Rock.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Rock 10 | m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 7a632f967e8ad42f5bd275898151ab6a, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 2800000, guid: 2dd3788f8589b40bf82a92d76ffc5091, type: 3} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | data: 31 | first: 32 | name: _ParallaxMap 33 | second: 34 | m_Texture: {fileID: 2800000, guid: 7a632f967e8ad42f5bd275898151ab6a, type: 3} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | m_Floats: 38 | data: 39 | first: 40 | name: _Shininess 41 | second: .078125 42 | data: 43 | first: 44 | name: _Parallax 45 | second: .0199999996 46 | m_Colors: 47 | data: 48 | first: 49 | name: _Color 50 | second: {r: .360294104, g: .266246766, b: .172199383, a: 1} 51 | data: 52 | first: 53 | name: _SpecColor 54 | second: {r: .867647052, g: .690472007, b: .523140132, a: 1} 55 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Objects/ocean_plane.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 681e41ee1260343b395ca58745c94870 3 | ModelImporter: 4 | serializedVersion: 15 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: kraut_plane 11 | 11100000: //RootNode 12 | materials: 13 | importMaterials: 1 14 | materialName: 3 15 | materialSearch: 1 16 | animations: 17 | legacyGenerateAnimations: 3 18 | bakeSimulation: 0 19 | optimizeGameObjects: 0 20 | animationCompression: 1 21 | animationRotationError: .5 22 | animationPositionError: .5 23 | animationScaleError: .5 24 | animationWrapMode: 0 25 | extraExposedTransformPaths: [] 26 | clipAnimations: [] 27 | isReadable: 1 28 | meshes: 29 | lODScreenPercentages: [] 30 | globalScale: 1 31 | meshCompression: 0 32 | addColliders: 0 33 | importBlendShapes: 1 34 | swapUVChannels: 0 35 | generateSecondaryUV: 0 36 | useFileUnits: 1 37 | optimizeMeshForGPU: 1 38 | weldVertices: 1 39 | secondaryUVAngleDistortion: 8 40 | secondaryUVAreaDistortion: 15.000001 41 | secondaryUVHardAngle: 88 42 | secondaryUVPackMargin: 4 43 | tangentSpace: 44 | normalSmoothAngle: 60 45 | splitTangentsAcrossUV: 1 46 | normalImportMode: 0 47 | tangentImportMode: 1 48 | importAnimation: 1 49 | copyAvatar: 0 50 | humanDescription: 51 | human: [] 52 | skeleton: [] 53 | armTwist: .5 54 | foreArmTwist: .5 55 | upperLegTwist: .5 56 | legTwist: .5 57 | armStretch: .0500000007 58 | legStretch: .0500000007 59 | feetSpacing: 0 60 | rootMotionBoneName: 61 | lastHumanDescriptionAvatarSource: {instanceID: 0} 62 | animationType: 1 63 | userData: 64 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/SpecularLightingEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(SpecularLighting))] 5 | public class SpecularLightingEditor : Editor 6 | { 7 | private SerializedObject serObj; 8 | private SerializedProperty specularLight; 9 | 10 | public void OnEnable () { 11 | serObj = new SerializedObject (target); 12 | specularLight = serObj.FindProperty("specularLight"); 13 | } 14 | 15 | public override void OnInspectorGUI () 16 | { 17 | serObj.Update(); 18 | 19 | GameObject go = ((SpecularLighting)serObj.targetObject).gameObject; 20 | WaterBase wb = (WaterBase)go.GetComponent(typeof(WaterBase)); 21 | 22 | if(!wb.sharedMaterial) 23 | return; 24 | 25 | if(wb.sharedMaterial.HasProperty("_WorldLightDir")) { 26 | GUILayout.Label ("Transform casting specular highlights", EditorStyles.miniBoldLabel); 27 | EditorGUILayout.PropertyField(specularLight, new GUIContent("Specular light")); 28 | 29 | if(wb.sharedMaterial.HasProperty("_SpecularColor")) 30 | WaterEditorUtility.SetMaterialColor( 31 | "_SpecularColor", 32 | EditorGUILayout.ColorField("Specular", 33 | WaterEditorUtility.GetMaterialColor("_SpecularColor", wb.sharedMaterial)), 34 | wb.sharedMaterial); 35 | if(wb.sharedMaterial.HasProperty("_Shininess")) 36 | WaterEditorUtility.SetMaterialFloat("_Shininess", EditorGUILayout.Slider( 37 | "Specular power", 38 | WaterEditorUtility.GetMaterialFloat("_Shininess", wb.sharedMaterial), 39 | 0.0F, 500.0F), wb.sharedMaterial); 40 | } 41 | else 42 | GUILayout.Label ("The shader doesn't have the needed _WorldLightDir property.", EditorStyles.miniBoldLabel); 43 | 44 | serObj.ApplyModifiedProperties(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Objects/Water Plane.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba6a41dc489914734857bb5924eb70ad 3 | ModelImporter: 4 | serializedVersion: 15 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: pPlane1 11 | 4300002: nurbsToPoly1 12 | 4300004: pCylinder1 13 | 4300006: waterPlaneMesh 14 | 11100000: //RootNode 15 | materials: 16 | importMaterials: 1 17 | materialName: 3 18 | materialSearch: 1 19 | animations: 20 | legacyGenerateAnimations: 0 21 | bakeSimulation: 0 22 | optimizeGameObjects: 0 23 | animationCompression: 1 24 | animationRotationError: .5 25 | animationPositionError: .5 26 | animationScaleError: .5 27 | animationWrapMode: 0 28 | extraExposedTransformPaths: [] 29 | clipAnimations: [] 30 | isReadable: 1 31 | meshes: 32 | lODScreenPercentages: [] 33 | globalScale: 1 34 | meshCompression: 0 35 | addColliders: 0 36 | importBlendShapes: 1 37 | swapUVChannels: 0 38 | generateSecondaryUV: 0 39 | useFileUnits: 1 40 | optimizeMeshForGPU: 1 41 | weldVertices: 1 42 | secondaryUVAngleDistortion: 8 43 | secondaryUVAreaDistortion: 15 44 | secondaryUVHardAngle: 88 45 | secondaryUVPackMargin: 4 46 | tangentSpace: 47 | normalSmoothAngle: 60 48 | splitTangentsAcrossUV: 0 49 | normalImportMode: 0 50 | tangentImportMode: 1 51 | importAnimation: 1 52 | copyAvatar: 0 53 | humanDescription: 54 | human: [] 55 | skeleton: [] 56 | armTwist: .5 57 | foreArmTwist: .5 58 | upperLegTwist: .5 59 | legTwist: .5 60 | armStretch: .0500000007 61 | legStretch: .0500000007 62 | feetSpacing: 0 63 | rootMotionBoneName: 64 | lastHumanDescriptionAvatarSource: {instanceID: 0} 65 | animationType: 1 66 | userData: 67 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/RockGenerator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | class RockGenerator : Generator { 5 | private Vector3 scale; 6 | 7 | public int Level = 2; 8 | private GameObject sphere; 9 | 10 | protected override IEnumerable> Open() { 11 | scale = new Vector3(RandomUniform(1f, 2f), RandomUniform(0.5f, 1f), RandomUniform(1f, 2f)); 12 | 13 | sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); 14 | sphere.renderer.material = Resources.Load("Materials/Rock"); 15 | sphere.transform.localScale = scale; 16 | 17 | yield return new Step(sphere); 18 | } 19 | 20 | protected override IEnumerable> GenerateChildren() { 21 | if (Level == 0) { 22 | yield break; 23 | } 24 | 25 | int boulders = RandomInteger(3, 10); 26 | 27 | for (int i = 0; i < boulders; i++) { 28 | var child = CreateChildren("Rock Fragment"); 29 | 30 | child.transform.localScale = Vector3.one * RandomUniform(0.25f, 0.5f); 31 | 32 | var spheric = RandomSphere().normalized; 33 | 34 | child.transform.localRotation = Quaternion.FromToRotation(Vector3.up, spheric); 35 | 36 | spheric.x *= sphere.transform.localScale.x; 37 | spheric.y *= sphere.transform.localScale.y; 38 | spheric.z *= sphere.transform.localScale.z; 39 | 40 | child.transform.localPosition = spheric * 0.4f; 41 | child.OpenSize = OpenSize; 42 | child.Level = Level - 1; 43 | 44 | yield return new Step(child); 45 | } 46 | 47 | //sphere.transform.localScale *= 0.5f; 48 | } 49 | 50 | protected override void PostChildrenClose() { 51 | //sphere.transform.localScale = scale; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/Scripts/RotateCamera.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RotateCamera : MonoBehaviour { 5 | 6 | Generator tree; 7 | 8 | // Use this for initialization 9 | void Start () { 10 | tree = GameObject.Find("Tree").GetComponent(); 11 | } 12 | 13 | // Update is called once per frame 14 | void Update () { 15 | float distance = this.transform.position.magnitude; 16 | 17 | if (Input.GetKey(KeyCode.W)) { 18 | transform.Translate(Vector3.forward * Time.deltaTime * distance); 19 | } 20 | else if (Input.GetKey(KeyCode.S)) { 21 | transform.Translate(Vector3.back * Time.deltaTime * distance); 22 | } 23 | 24 | distance = this.transform.position.magnitude; 25 | 26 | if (Input.GetKey(KeyCode.A)) { 27 | transform.Translate(Vector3.left * Time.deltaTime * distance); 28 | } 29 | else if (Input.GetKey(KeyCode.D)) { 30 | transform.Translate(Vector3.right * Time.deltaTime * distance); 31 | } 32 | 33 | if (Input.GetKey(KeyCode.Space)) { 34 | transform.Translate(Vector3.up * Time.deltaTime * distance); 35 | } 36 | else if (Input.GetKey(KeyCode.LeftControl)) { 37 | transform.Translate(Vector3.down * Time.deltaTime * distance); 38 | } 39 | 40 | transform.position = Vector3.ClampMagnitude(transform.position, distance); 41 | transform.LookAt(Vector3.up * 3f); 42 | } 43 | 44 | void OnGUI() { 45 | GL.wireframe = false; 46 | 47 | GUI.Box(new Rect(20, 20, 200, 25), string.Format("Open Nodes: {0}", Generator.OpenNodes)); 48 | GUI.Box(new Rect(20, 50, 200, 25), string.Format("Steps per Second: {0:0.0}", Generator.StepsPerSecond)); 49 | GUI.Box(new Rect(20, 80, 200, 25), string.Format("Wireframe: {0}", GL.wireframe)); 50 | 51 | if (GUI.Button(new Rect(Screen.width - 120, 20, 100, 30), "Restart")) { 52 | tree.Restart(); 53 | } 54 | if (GUI.Button(new Rect(Screen.width - 120, 55, 100, 30), "Quit")) { 55 | Application.Quit(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Resources/Prefabs/Backlight.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 108: {fileID: 10800000} 12 | m_Layer: 0 13 | m_Name: Backlight 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: -.867257118, y: -.112642556, z: .220169529, w: -.432090551} 26 | m_LocalPosition: {x: 0, y: 100, z: 0} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!108 &10800000 32 | Light: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 100000} 37 | m_Enabled: 1 38 | serializedVersion: 3 39 | m_Type: 1 40 | m_Color: {r: .752054513, g: .945939541, b: .95588237, a: 1} 41 | m_Intensity: .100000001 42 | m_Range: 10 43 | m_SpotAngle: 30 44 | m_CookieSize: 10 45 | m_Shadows: 46 | m_Type: 0 47 | m_Resolution: -1 48 | m_Strength: 1 49 | m_Bias: .0500000007 50 | m_Softness: 4 51 | m_SoftnessFade: 1 52 | m_Cookie: {fileID: 0} 53 | m_DrawHalo: 0 54 | m_ActuallyLightmapped: 0 55 | m_Flare: {fileID: 0} 56 | m_RenderMode: 0 57 | m_CullingMask: 58 | serializedVersion: 2 59 | m_Bits: 4294967295 60 | m_Lightmapping: 1 61 | m_ShadowSamples: 1 62 | m_ShadowRadius: 0 63 | m_ShadowAngle: 0 64 | m_IndirectIntensity: 1 65 | m_AreaSize: {x: 1, y: 1} 66 | --- !u!1001 &100100000 67 | Prefab: 68 | m_ObjectHideFlags: 1 69 | serializedVersion: 2 70 | m_Modification: 71 | m_TransformParent: {fileID: 0} 72 | m_Modifications: [] 73 | m_RemovedComponents: [] 74 | m_ParentPrefab: {fileID: 0} 75 | m_RootGameObject: {fileID: 100000} 76 | m_IsPrefabParent: 1 77 | m_IsExploded: 1 78 | -------------------------------------------------------------------------------- /Assets/Resources/Prefabs/Sun.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 108: {fileID: 10800000} 12 | m_Layer: 0 13 | m_Name: Sun 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &400000 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 100000} 25 | m_LocalRotation: {x: .105274446, y: .24612008, z: -.0242454726, w: .963200092} 26 | m_LocalPosition: {x: 0, y: 100, z: 0} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!108 &10800000 32 | Light: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 100000} 37 | m_Enabled: 1 38 | serializedVersion: 3 39 | m_Type: 1 40 | m_Color: {r: 1, g: 1, b: .686274529, a: 1} 41 | m_Intensity: .5 42 | m_Range: 10 43 | m_SpotAngle: 30 44 | m_CookieSize: 10 45 | m_Shadows: 46 | m_Type: 2 47 | m_Resolution: -1 48 | m_Strength: .800000012 49 | m_Bias: .0500000007 50 | m_Softness: 4 51 | m_SoftnessFade: 1 52 | m_Cookie: {fileID: 0} 53 | m_DrawHalo: 0 54 | m_ActuallyLightmapped: 0 55 | m_Flare: {fileID: 12100000, guid: 54fbbf098d116effa00081aba8ad6659, type: 2} 56 | m_RenderMode: 0 57 | m_CullingMask: 58 | serializedVersion: 2 59 | m_Bits: 4294967295 60 | m_Lightmapping: 1 61 | m_ShadowSamples: 1 62 | m_ShadowRadius: 0 63 | m_ShadowAngle: 0 64 | m_IndirectIntensity: 1 65 | m_AreaSize: {x: 1, y: 1} 66 | --- !u!1001 &100100000 67 | Prefab: 68 | m_ObjectHideFlags: 1 69 | serializedVersion: 2 70 | m_Modification: 71 | m_TransformParent: {fileID: 0} 72 | m_Modifications: [] 73 | m_RemovedComponents: [] 74 | m_ParentPrefab: {fileID: 0} 75 | m_RootGameObject: {fileID: 100000} 76 | m_IsPrefabParent: 1 77 | m_IsExploded: 1 78 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/PlanarReflectionEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(PlanarReflection))] 5 | public class PlanarReflectionEditor : Editor 6 | { 7 | private SerializedObject serObj; 8 | 9 | //private SerializedProperty wavesFrequency; 10 | 11 | // reflection 12 | private SerializedProperty reflectionMask; 13 | private SerializedProperty reflectSkybox; 14 | private SerializedProperty clearColor; 15 | 16 | bool showKidsWithReflectionHint = false; 17 | 18 | public void OnEnable () { 19 | serObj = new SerializedObject (target); 20 | 21 | reflectionMask = serObj.FindProperty("reflectionMask"); 22 | reflectSkybox = serObj.FindProperty("reflectSkybox"); 23 | clearColor = serObj.FindProperty("clearColor"); 24 | } 25 | 26 | public override void OnInspectorGUI () 27 | { 28 | GUILayout.Label ("Render planar reflections and use GrabPass for refractions", EditorStyles.miniBoldLabel); 29 | 30 | if(!SystemInfo.supportsRenderTextures) 31 | EditorGUILayout.HelpBox("Realtime reflections not supported", MessageType.Warning); 32 | 33 | serObj.Update(); 34 | 35 | EditorGUILayout.PropertyField(reflectionMask, new GUIContent("Reflection layers")); 36 | EditorGUILayout.PropertyField(reflectSkybox, new GUIContent("Use skybox")); 37 | EditorGUILayout.PropertyField(clearColor, new GUIContent("Clear color")); 38 | 39 | showKidsWithReflectionHint = EditorGUILayout.BeginToggleGroup("Show all tiles", showKidsWithReflectionHint); 40 | if (showKidsWithReflectionHint) { 41 | int i = 0; 42 | foreach(Transform t in ((PlanarReflection)target).transform) { 43 | if (t.GetComponent()) { 44 | if(i%2==0) 45 | EditorGUILayout.BeginHorizontal(); 46 | EditorGUILayout.ObjectField(t, typeof(Transform), true); 47 | if(i%2==1) 48 | EditorGUILayout.EndHorizontal(); 49 | i = (i+1)%2; 50 | } 51 | } 52 | if(i>0) 53 | EditorGUILayout.EndHorizontal(); 54 | } 55 | EditorGUILayout.EndToggleGroup(); 56 | 57 | serObj.ApplyModifiedProperties(); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /Assets/Resources/Skyboxes/DawnDusk Skybox.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: DawnDusk Skybox 10 | m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 0} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _FrontTex 26 | second: 27 | m_Texture: {fileID: 2800000, guid: 0568ecdd797316641b0203860b3929d9, type: 3} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | data: 31 | first: 32 | name: _BackTex 33 | second: 34 | m_Texture: {fileID: 2800000, guid: fe48ca40e9be666419e7d1a4bf3d808a, type: 3} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | data: 38 | first: 39 | name: _LeftTex 40 | second: 41 | m_Texture: {fileID: 2800000, guid: 9785a5533d9270849a276a4bfbfa9418, type: 3} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | data: 45 | first: 46 | name: _RightTex 47 | second: 48 | m_Texture: {fileID: 2800000, guid: 6dda5f499bc82c442aab32e4a6bdbe40, type: 3} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | data: 52 | first: 53 | name: _UpTex 54 | second: 55 | m_Texture: {fileID: 2800000, guid: a6de6086ecd5fe84699b0bc7e00608a4, type: 3} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | data: 59 | first: 60 | name: _DownTex 61 | second: 62 | m_Texture: {fileID: 2800000, guid: 9d2a2ce9c718dc24dae3b1ee427b27ee, type: 3} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | m_Floats: {} 66 | m_Colors: 67 | data: 68 | first: 69 | name: _Color 70 | second: {r: 1, g: 1, b: 1, a: 1} 71 | data: 72 | first: 73 | name: _Tint 74 | second: {r: .5, g: .5, b: .5, a: .5} 75 | --- !u!1002 &2100001 76 | EditorExtensionImpl: 77 | serializedVersion: 6 78 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshLayers: 5 | m_ObjectHideFlags: 0 6 | Built-in Layer 0: 7 | name: Default 8 | cost: 1 9 | editType: 2 10 | Built-in Layer 1: 11 | name: Not Walkable 12 | cost: 1 13 | editType: 0 14 | Built-in Layer 2: 15 | name: Jump 16 | cost: 2 17 | editType: 2 18 | User Layer 0: 19 | name: 20 | cost: 1 21 | editType: 3 22 | User Layer 1: 23 | name: 24 | cost: 1 25 | editType: 3 26 | User Layer 2: 27 | name: 28 | cost: 1 29 | editType: 3 30 | User Layer 3: 31 | name: 32 | cost: 1 33 | editType: 3 34 | User Layer 4: 35 | name: 36 | cost: 1 37 | editType: 3 38 | User Layer 5: 39 | name: 40 | cost: 1 41 | editType: 3 42 | User Layer 6: 43 | name: 44 | cost: 1 45 | editType: 3 46 | User Layer 7: 47 | name: 48 | cost: 1 49 | editType: 3 50 | User Layer 8: 51 | name: 52 | cost: 1 53 | editType: 3 54 | User Layer 9: 55 | name: 56 | cost: 1 57 | editType: 3 58 | User Layer 10: 59 | name: 60 | cost: 1 61 | editType: 3 62 | User Layer 11: 63 | name: 64 | cost: 1 65 | editType: 3 66 | User Layer 12: 67 | name: 68 | cost: 1 69 | editType: 3 70 | User Layer 13: 71 | name: 72 | cost: 1 73 | editType: 3 74 | User Layer 14: 75 | name: 76 | cost: 1 77 | editType: 3 78 | User Layer 15: 79 | name: 80 | cost: 1 81 | editType: 3 82 | User Layer 16: 83 | name: 84 | cost: 1 85 | editType: 3 86 | User Layer 17: 87 | name: 88 | cost: 1 89 | editType: 3 90 | User Layer 18: 91 | name: 92 | cost: 1 93 | editType: 3 94 | User Layer 19: 95 | name: 96 | cost: 1 97 | editType: 3 98 | User Layer 20: 99 | name: 100 | cost: 1 101 | editType: 3 102 | User Layer 21: 103 | name: 104 | cost: 1 105 | editType: 3 106 | User Layer 22: 107 | name: 108 | cost: 1 109 | editType: 3 110 | User Layer 23: 111 | name: 112 | cost: 1 113 | editType: 3 114 | User Layer 24: 115 | name: 116 | cost: 1 117 | editType: 3 118 | User Layer 25: 119 | name: 120 | cost: 1 121 | editType: 3 122 | User Layer 26: 123 | name: 124 | cost: 1 125 | editType: 3 126 | User Layer 27: 127 | name: 128 | cost: 1 129 | editType: 3 130 | User Layer 28: 131 | name: 132 | cost: 1 133 | editType: 3 134 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/WaterEditorUtility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | class WaterEditorUtility 5 | { 6 | // helper functions to retrieve & set material values 7 | 8 | public static float GetMaterialFloat(System.String name, Material mat) { 9 | return mat.GetFloat(name); 10 | } 11 | public static void SetMaterialFloat(System.String name, float f, Material mat) { 12 | mat.SetFloat(name, f); 13 | } 14 | 15 | public static Color GetMaterialColor(System.String name, Material mat) { 16 | return mat.GetColor(name); 17 | } 18 | public static void SetMaterialColor(System.String name, Color color, Material mat) { 19 | mat.SetColor(name, color); 20 | } 21 | public static Vector4 GetMaterialVector(System.String name, Material mat) { 22 | return mat.GetVector(name); 23 | } 24 | public static void SetMaterialVector(System.String name, Vector4 vector, Material mat) { 25 | mat.SetVector(name, vector); 26 | } 27 | public static Texture GetMaterialTexture(System.String theName, Material mat) { 28 | return mat.GetTexture(theName); 29 | } 30 | public static void SetMaterialTexture(System.String theName, Texture parameter, Material mat) { 31 | mat.SetTexture(theName, parameter); 32 | } 33 | 34 | public static Material LocateValidWaterMaterial(Transform parent) 35 | { 36 | if(parent.renderer && parent.renderer.sharedMaterial) 37 | return parent.renderer.sharedMaterial; 38 | foreach( Transform t in parent) 39 | { 40 | if(t.renderer && t.renderer.sharedMaterial) 41 | return t.renderer.sharedMaterial; 42 | } 43 | return null; 44 | } 45 | 46 | public static void CurveGui (System.String name, SerializedObject serObj, Color color) 47 | { 48 | AnimationCurve curve = new AnimationCurve(new Keyframe(0, 0.0f, 1.0f, 1.0f), new Keyframe(1, 1.0f, 1.0f, 1.0f)); 49 | curve = EditorGUILayout.CurveField(new GUIContent (name), curve, color, new Rect (0.0f,0.0f,1.0f,1.0f)); 50 | 51 | //if (GUI.changed) { 52 | // AnimationCurveChanged(((WaterBase)serObj.targetObject).sharedMaterial, curve); 53 | //((WaterBase)serObj.targetObject).gameObject.SendMessage ("AnimationCurveChanged", SendMessageOptions.DontRequireReceiver); 54 | //} 55 | } 56 | /* 57 | public static void AnimationCurveChanged(Material sharedMaterial, AnimationCurve fresnelCurve) 58 | { 59 | Debug.Log("AnimationCurveChanged"); 60 | Texture2D fresnel = (Texture2D)sharedMaterial.GetTexture("_Fresnel"); 61 | if(!fresnel) 62 | fresnel = new Texture2D(256,1); 63 | 64 | for (int i = 0; i < 256; i++) 65 | { 66 | float val = Mathf.Clamp01(fresnelCurve.Evaluate((float)i)/255.0f); 67 | Debug.Log(""+(((float)i)/255.0f) +": "+val); 68 | fresnel.SetPixel(i, 0, new Color(val,val,val,val)); 69 | } 70 | fresnel.Apply(); 71 | 72 | sharedMaterial.SetTexture("_Fresnel", fresnel); 73 | 74 | } */ 75 | } -------------------------------------------------------------------------------- /Assets/Scripts/Generator/SectorGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class SectorGenerator : Generator { 6 | public float Radius; 7 | 8 | public SectorGenerator() { 9 | OpenSize = 100f; 10 | } 11 | 12 | protected override IEnumerable> Open() { 13 | var ball = GameObject.CreatePrimitive(PrimitiveType.Sphere); 14 | ball.transform.localScale = new Vector3(1, 0.25f, 1) * 2 * Radius; 15 | ball.renderer.material.color = new Color(0.8f, 0.2f, 0.4f); 16 | //ball.AddComponent().MinVisibleDistance = 20000f; 17 | 18 | yield return new Step(ball); 19 | } 20 | 21 | protected override IEnumerable> GenerateChildren() { 22 | int count = 0; 23 | float gridSize = 200; 24 | float maxHeight = 200f; 25 | float minHeight = 2f; 26 | float maxRadius = 1000f; 27 | 28 | float maxProb = 1f; 29 | float minProb = 0f; 30 | 31 | if (Terrain != null) { 32 | while (!Terrain.Ready) { 33 | yield return new Step(1f); 34 | } 35 | } 36 | 37 | for (float x = -Radius; x <= Radius; x += gridSize) { 38 | for (float z = -Radius; z <= Radius; z += gridSize) { 39 | x = x - x % gridSize; 40 | z = z - z % gridSize; 41 | 42 | Vector3 childCenter = new Vector3(x, 0, z); 43 | float d = childCenter.magnitude; 44 | float ds = (Radius - d) / Radius; 45 | float p = (maxProb - minProb) * ds + minProb; 46 | 47 | if (d > Radius - gridSize / 2 || !RandomBernoulli(p)) { 48 | yield return new Step(); 49 | continue; 50 | } 51 | 52 | if (Terrain != null) { 53 | Vector3 transformedCenter = this.transform.TransformPoint(childCenter); 54 | transformedCenter = Terrain.SamplePoint(transformedCenter); 55 | childCenter = this.transform.InverseTransformPoint(transformedCenter); 56 | 57 | Vector3 normal = Terrain.SampleNormal(transformedCenter, gridSize); 58 | 59 | Debug.DrawRay(transformedCenter, normal * 100f, Color.red, 100f); 60 | 61 | if (transformedCenter.y < 10 || Vector3.Angle(normal, Vector3.up) > 30) { 62 | yield return new Step(); 63 | continue; 64 | } 65 | } 66 | 67 | float mh = Mathf.Max(2 * minHeight, maxHeight * ds * this.Radius / maxRadius); 68 | float h = RandomUniform(minHeight, mh); 69 | 70 | count++; 71 | 72 | var block = CreateChildren("Block"); 73 | block.transform.localPosition = childCenter; 74 | block.Width = 160; 75 | block.Depth = 160; 76 | block.Height = h; 77 | block.Terrain = Terrain; 78 | 79 | yield return new Step(block); 80 | } 81 | } 82 | } 83 | 84 | public TerrainGenerator Terrain; 85 | } 86 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Daylight Water.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &100000 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 400000} 11 | - 33: {fileID: 3300000} 12 | - 23: {fileID: 2300000} 13 | - 114: {fileID: 11400000} 14 | m_Layer: 4 15 | m_Name: Daylight Water 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1002 &100001 22 | EditorExtensionImpl: 23 | serializedVersion: 6 24 | --- !u!4 &400000 25 | Transform: 26 | m_ObjectHideFlags: 1 27 | m_PrefabParentObject: {fileID: 0} 28 | m_PrefabInternal: {fileID: 100100000} 29 | m_GameObject: {fileID: 100000} 30 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 31 | m_LocalPosition: {x: 0, y: 0, z: 0} 32 | m_LocalScale: {x: 16, y: 1, z: 16} 33 | m_Children: [] 34 | m_Father: {fileID: 0} 35 | m_RootOrder: 0 36 | --- !u!1002 &400001 37 | EditorExtensionImpl: 38 | serializedVersion: 6 39 | --- !u!23 &2300000 40 | Renderer: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 100000} 45 | m_Enabled: 1 46 | m_CastShadows: 0 47 | m_ReceiveShadows: 0 48 | m_LightmapIndex: 255 49 | m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0} 50 | m_Materials: 51 | - {fileID: 2100000, guid: ae162c0523ab4468bb03ef160eb672e2, type: 2} 52 | m_SubsetIndices: 53 | m_StaticBatchRoot: {fileID: 0} 54 | m_UseLightProbes: 0 55 | m_LightProbeAnchor: {fileID: 0} 56 | m_ScaleInLightmap: 1 57 | m_SortingLayerID: 0 58 | m_SortingOrder: 0 59 | --- !u!1002 &2300001 60 | EditorExtensionImpl: 61 | serializedVersion: 6 62 | --- !u!33 &3300000 63 | MeshFilter: 64 | m_ObjectHideFlags: 1 65 | m_PrefabParentObject: {fileID: 0} 66 | m_PrefabInternal: {fileID: 100100000} 67 | m_GameObject: {fileID: 100000} 68 | m_Mesh: {fileID: 4300006, guid: ba6a41dc489914734857bb5924eb70ad, type: 3} 69 | --- !u!1002 &3300001 70 | EditorExtensionImpl: 71 | serializedVersion: 6 72 | --- !u!114 &11400000 73 | MonoBehaviour: 74 | m_ObjectHideFlags: 1 75 | m_PrefabParentObject: {fileID: 0} 76 | m_PrefabInternal: {fileID: 100100000} 77 | m_GameObject: {fileID: 100000} 78 | m_Enabled: 1 79 | m_EditorHideFlags: 0 80 | m_Script: {fileID: 11500000, guid: a3d3ef1a5bbfb4e0a910fbbe5830b1f9, type: 3} 81 | m_Name: 82 | m_EditorClassIdentifier: 83 | m_WaterMode: 2 84 | m_DisablePixelLights: 1 85 | m_TextureSize: 256 86 | m_ClipPlaneOffset: .0700000003 87 | m_ReflectLayers: 88 | serializedVersion: 2 89 | m_Bits: 4294967295 90 | m_RefractLayers: 91 | serializedVersion: 2 92 | m_Bits: 4294967295 93 | --- !u!1002 &11400001 94 | EditorExtensionImpl: 95 | serializedVersion: 6 96 | --- !u!1001 &100100000 97 | Prefab: 98 | m_ObjectHideFlags: 1 99 | serializedVersion: 2 100 | m_Modification: 101 | m_TransformParent: {fileID: 0} 102 | m_Modifications: [] 103 | m_RemovedComponents: [] 104 | m_ParentPrefab: {fileID: 0} 105 | m_RootGameObject: {fileID: 100000} 106 | m_IsPrefabParent: 1 107 | m_IsExploded: 1 108 | --- !u!1002 &100100001 109 | EditorExtensionImpl: 110 | serializedVersion: 6 111 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | blendWeights: 1 18 | textureQuality: 1 19 | anisotropicTextures: 0 20 | antiAliasing: 0 21 | softParticles: 0 22 | softVegetation: 0 23 | vSyncCount: 0 24 | lodBias: .300000012 25 | maximumLODLevel: 0 26 | particleRaycastBudget: 4 27 | excludedTargetPlatforms: [] 28 | - serializedVersion: 2 29 | name: Fast 30 | pixelLightCount: 0 31 | shadows: 0 32 | shadowResolution: 0 33 | shadowProjection: 1 34 | shadowCascades: 1 35 | shadowDistance: 20 36 | blendWeights: 2 37 | textureQuality: 0 38 | anisotropicTextures: 0 39 | antiAliasing: 0 40 | softParticles: 0 41 | softVegetation: 0 42 | vSyncCount: 0 43 | lodBias: .400000006 44 | maximumLODLevel: 0 45 | particleRaycastBudget: 16 46 | excludedTargetPlatforms: [] 47 | - serializedVersion: 2 48 | name: Simple 49 | pixelLightCount: 1 50 | shadows: 1 51 | shadowResolution: 0 52 | shadowProjection: 1 53 | shadowCascades: 1 54 | shadowDistance: 20 55 | blendWeights: 2 56 | textureQuality: 0 57 | anisotropicTextures: 1 58 | antiAliasing: 0 59 | softParticles: 0 60 | softVegetation: 0 61 | vSyncCount: 0 62 | lodBias: .699999988 63 | maximumLODLevel: 0 64 | particleRaycastBudget: 64 65 | excludedTargetPlatforms: [] 66 | - serializedVersion: 2 67 | name: Good 68 | pixelLightCount: 2 69 | shadows: 2 70 | shadowResolution: 1 71 | shadowProjection: 1 72 | shadowCascades: 2 73 | shadowDistance: 40 74 | blendWeights: 2 75 | textureQuality: 0 76 | anisotropicTextures: 1 77 | antiAliasing: 0 78 | softParticles: 0 79 | softVegetation: 1 80 | vSyncCount: 0 81 | lodBias: 1 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 256 84 | excludedTargetPlatforms: [] 85 | - serializedVersion: 2 86 | name: Beautiful 87 | pixelLightCount: 3 88 | shadows: 2 89 | shadowResolution: 2 90 | shadowProjection: 1 91 | shadowCascades: 2 92 | shadowDistance: 70 93 | blendWeights: 4 94 | textureQuality: 0 95 | anisotropicTextures: 2 96 | antiAliasing: 2 97 | softParticles: 1 98 | softVegetation: 1 99 | vSyncCount: 1 100 | lodBias: 1.5 101 | maximumLODLevel: 0 102 | particleRaycastBudget: 1024 103 | excludedTargetPlatforms: [] 104 | - serializedVersion: 2 105 | name: Fantastic 106 | pixelLightCount: 4 107 | shadows: 2 108 | shadowResolution: 2 109 | shadowProjection: 1 110 | shadowCascades: 4 111 | shadowDistance: 150 112 | blendWeights: 4 113 | textureQuality: 0 114 | anisotropicTextures: 2 115 | antiAliasing: 2 116 | softParticles: 1 117 | softVegetation: 1 118 | vSyncCount: 1 119 | lodBias: 2 120 | maximumLODLevel: 0 121 | particleRaycastBudget: 4096 122 | excludedTargetPlatforms: [] 123 | m_PerPlatformDefaultQuality: {} 124 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BuildingGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class BuildingGenerator : Generator { 7 | public BlockType Type; 8 | public float Width; 9 | public float Height; 10 | public float Depth; 11 | 12 | public BuildingGenerator() { 13 | OpenSize = 100f; 14 | } 15 | 16 | protected override IEnumerable> Open() { 17 | GameObject building = null; 18 | 19 | switch (this.Type) { 20 | case BlockType.Office: 21 | building = CreateOffice(); 22 | break; 23 | case BlockType.Residential: 24 | building = CreateResidential(); 25 | break; 26 | case BlockType.Comercial: 27 | building = CreateComerial(); 28 | break; 29 | case BlockType.Industrial: 30 | building = CreateIndustrial(); 31 | break; 32 | case BlockType.Facility: 33 | building = CreateFacility(); 34 | break; 35 | case BlockType.Park: 36 | building = CreatePark(); 37 | break; 38 | default: 39 | break; 40 | } 41 | 42 | building.transform.localScale = new Vector3(Width, Height, Depth); 43 | building.AddComponent(); 44 | 45 | yield return new Step(building); 46 | } 47 | 48 | private GameObject CreateOffice() { 49 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 50 | go.renderer.material.color = Color.white; 51 | return go; 52 | } 53 | 54 | private GameObject CreateResidential() { 55 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 56 | go.renderer.material.color = Color.red; 57 | return go; 58 | } 59 | 60 | private GameObject CreateComerial() { 61 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 62 | go.renderer.material.color = Color.blue; 63 | return go; 64 | } 65 | 66 | private GameObject CreateIndustrial() { 67 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 68 | go.renderer.material.color = Color.magenta; 69 | return go; 70 | } 71 | 72 | private GameObject CreateFacility() { 73 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 74 | go.renderer.material.color = Color.yellow; 75 | return go; 76 | } 77 | 78 | private GameObject CreatePark() { 79 | var go = GameObject.CreatePrimitive(PrimitiveType.Cube); 80 | 81 | // int numberOfTrees = (int)RandomUniform(5, 20); 82 | 83 | // for(int i=0; i < numberOfTrees; i++) { 84 | // float x = (float)(this.rnd.NextDouble() - 0.5); // * this.scale.x; 85 | // float z = (float)(this.rnd.NextDouble() - 0.5); // * this.scale.z; 86 | 87 | // var tree = CreateTree(); 88 | // tree.transform.position = new Vector3(x, 0, z); 89 | // tree.transform.parent = go.transform; 90 | // } 91 | 92 | go.renderer.material.color = Color.green; 93 | return go; 94 | } 95 | 96 | private GameObject CreateTree() { 97 | 98 | // float height = (float) this.rnd.NextDouble() * 5f + 5f; 99 | // float width = (float) this.rnd.NextDouble() * 0.05f + 0.01f; 100 | 101 | var go = GameObject.CreatePrimitive(PrimitiveType.Cylinder); 102 | // go.transform.localScale = new Vector3(width, height, width); 103 | // go.renderer.material.color = new Color(0.7f, 0.5f, 0, 1); 104 | 105 | // int copes = this.rnd.Next(1, 10); 106 | 107 | // for(int i=0; i> Open() { 18 | if (Terrain != null) { 19 | while (!Terrain.Ready) { 20 | yield return new Step(1f); 21 | } 22 | } 23 | 24 | var ball = GameObject.CreatePrimitive(PrimitiveType.Sphere); 25 | ball.transform.localScale = new Vector3(1, 0.25f, 1) * Size * Regions * 1.5f; 26 | ball.renderer.material.color = new Color(Density, 1 - Density, Density * Density); 27 | ball.AddComponent().MinVisibleDistance = 50000f; 28 | 29 | if (Terrain != null) { 30 | ball.transform.localPosition = this.transform.InverseTransformPoint(Terrain.SamplePoint(this.transform.position)); 31 | } 32 | 33 | yield return new Step(ball); 34 | } 35 | 36 | protected override IEnumerable> GenerateChildren() { 37 | var sectors = new List(); 38 | 39 | for(int i=0; i(); 43 | continue; 44 | } 45 | 46 | float x = i * Size + RandomUniform(0, Size - 100f) - Size * Regions / 2; 47 | float z = j * Size + RandomUniform(0, Size - 100f) - Size * Regions / 2; 48 | float rot = RandomUniform(0, 45); 49 | 50 | Vector3 localPosition = this.transform.TransformPoint(new Vector3(x, 0, z)); 51 | 52 | if (Terrain != null) { 53 | localPosition = Terrain.SamplePoint(localPosition); 54 | 55 | if (localPosition.y < 10f || Vector3.Angle(Terrain.SampleNormal(localPosition, Size), Vector3.up) > 30f) { 56 | yield return new Step(); 57 | continue; 58 | } 59 | } 60 | else if (!RandomBernoulli(Density)) { 61 | yield return new Step(); 62 | continue; 63 | } 64 | 65 | var sector = CreateChildren("Sector"); 66 | 67 | sector.transform.localPosition = this.transform.InverseTransformPoint(localPosition); 68 | sector.transform.Rotate(0, rot, 0); 69 | sector.Radius = 100f; 70 | sector.Terrain = Terrain; 71 | 72 | sectors.Add(sector); 73 | yield return new Step(); 74 | } 75 | } 76 | 77 | bool[] cannotGrow = new bool[sectors.Count]; 78 | int canGrow = sectors.Count; 79 | 80 | while (canGrow > 0) { 81 | for(int i=0; i(); 105 | } 106 | } 107 | 108 | foreach (var sector in sectors) { 109 | yield return new Step(sector); 110 | } 111 | } 112 | } -------------------------------------------------------------------------------- /Assets/Scripts/Fader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Fader : MonoBehaviour { 5 | 6 | public enum Status { 7 | CheckingFadeIn, 8 | CheckingFadeOut, 9 | FadingIn, 10 | FadingOut, 11 | FadingOutForDestruction, 12 | } 13 | 14 | private Shader transparentShader; 15 | private Shader originalShader; 16 | private Generator parent; 17 | 18 | private bool destroyed; 19 | 20 | public float FadeTime = 0.5f; 21 | public int FadeSteps = 10; 22 | public Status AnimationStatus; 23 | 24 | public float MinVisibleDistance; 25 | public float CameraDistance; 26 | 27 | private bool InView() { 28 | if (this.parent == null) { 29 | return false; 30 | } 31 | 32 | return this.parent.ScreenSize > MinVisibleDistance; 33 | } 34 | 35 | // Use this for initialization 36 | void Start() { 37 | parent = this.transform.parent.GetComponent(); 38 | transparentShader = Shader.Find("Transparent/Diffuse"); 39 | originalShader = this.renderer.material.shader; 40 | 41 | if (!InView()) { 42 | Hide(); 43 | StartCoroutine(CheckFadeIn()); 44 | } 45 | else { 46 | Hide(); 47 | FadeIn(); 48 | } 49 | } 50 | 51 | private IEnumerator CheckFadeOut() { 52 | AnimationStatus = Status.CheckingFadeOut; 53 | 54 | while (true) { 55 | if (destroyed) { 56 | yield break; 57 | } 58 | if (!InView()) { 59 | FadeOut(); 60 | yield break; 61 | } 62 | 63 | yield return new WaitForSeconds(0.25f); 64 | } 65 | } 66 | 67 | private void Hide() { 68 | this.renderer.material.shader = transparentShader; 69 | SetAlpha(0f); 70 | } 71 | 72 | private void Show() { 73 | this.renderer.material.shader = originalShader; 74 | SetAlpha(1f); 75 | } 76 | 77 | private IEnumerator CheckFadeIn() { 78 | AnimationStatus = Status.CheckingFadeIn; 79 | 80 | while (true) { 81 | if (destroyed) { 82 | yield break; 83 | } 84 | if (InView()) { 85 | FadeIn(); 86 | yield break; 87 | } 88 | 89 | yield return new WaitForSeconds(0.25f); 90 | } 91 | } 92 | 93 | private void SetAlpha(float alpha) { 94 | var color = renderer.material.color; 95 | color.a = alpha; 96 | renderer.material.color = color; 97 | } 98 | 99 | public void FadeOutAndDestroy() { 100 | AnimationStatus = Status.FadingOutForDestruction; 101 | 102 | this.renderer.material.shader = transparentShader; 103 | StartCoroutine(FadeOutInternal(true)); 104 | } 105 | 106 | public void FadeOut() { 107 | AnimationStatus = Status.FadingOut; 108 | 109 | this.renderer.material.shader = transparentShader; 110 | StartCoroutine(FadeOutInternal(false)); 111 | } 112 | 113 | public void FadeIn() { 114 | AnimationStatus = Status.FadingIn; 115 | 116 | this.renderer.material.shader = transparentShader; 117 | StartCoroutine(FadeInInternal()); 118 | } 119 | 120 | private IEnumerator FadeInInternal() { 121 | float alpha = renderer.material.color.a; 122 | 123 | for (float i = 0; i <= FadeSteps; i++) { 124 | SetAlpha(alpha + (i / FadeSteps) * (1 - alpha)); 125 | yield return new WaitForSeconds(FadeTime / FadeSteps); 126 | } 127 | 128 | Show(); 129 | StartCoroutine(CheckFadeOut()); 130 | } 131 | 132 | private IEnumerator FadeOutInternal(bool destroy) { 133 | float alpha = renderer.material.color.a; 134 | 135 | for (float i = 1; i <= FadeSteps; i++) { 136 | SetAlpha(alpha * (1 - i / FadeSteps)); 137 | yield return new WaitForSeconds(FadeTime / FadeSteps); 138 | } 139 | 140 | Hide(); 141 | 142 | if (destroy) { 143 | Destroy(this.gameObject); 144 | destroyed = true; 145 | } 146 | else { 147 | StartCoroutine(CheckFadeIn()); 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /Assets/Resources/Light Flares/50mm Zoom.flare: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!121 &12100000 4 | Flare: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: 50mm Zoom 9 | m_FlareTexture: {fileID: 2800000, guid: 23a02ac18d11c9ffa0009c58a8ad6659, type: 3} 10 | m_TextureLayout: 1 11 | m_Elements: 12 | - m_ImageIndex: 9 13 | m_Position: 0 14 | m_Size: 50 15 | m_Color: {r: 1, g: 1, b: 1, a: 1} 16 | m_UseLightColor: 1 17 | m_Rotate: 0 18 | m_Zoom: 1 19 | m_Fade: 1 20 | - m_ImageIndex: 0 21 | m_Position: 0 22 | m_Size: 50 23 | m_Color: {r: .0941176489, g: .0941176489, b: .0941176489, a: 1} 24 | m_UseLightColor: 1 25 | m_Rotate: 1 26 | m_Zoom: 1 27 | m_Fade: 1 28 | - m_ImageIndex: 5 29 | m_Position: 0 30 | m_Size: 20 31 | m_Color: {r: .0313725509, g: .0196078438, b: .0196078438, a: 1} 32 | m_UseLightColor: 1 33 | m_Rotate: 0 34 | m_Zoom: 0 35 | m_Fade: 1 36 | - m_ImageIndex: 5 37 | m_Position: -.269999981 38 | m_Size: 36.3899994 39 | m_Color: {r: .0313725509, g: .0235294122, b: .0196078438, a: 1} 40 | m_UseLightColor: 1 41 | m_Rotate: 0 42 | m_Zoom: 0 43 | m_Fade: 1 44 | - m_ImageIndex: 5 45 | m_Position: -.74999994 46 | m_Size: 28.6899986 47 | m_Color: {r: .0196078438, g: .0156862754, b: .0117647061, a: 1} 48 | m_UseLightColor: 1 49 | m_Rotate: 0 50 | m_Zoom: 0 51 | m_Fade: 1 52 | - m_ImageIndex: 3 53 | m_Position: 0 54 | m_Size: 10.2500019 55 | m_Color: {r: .447058827, g: 0, b: .00784313772, a: 1} 56 | m_UseLightColor: 1 57 | m_Rotate: 0 58 | m_Zoom: 0 59 | m_Fade: 1 60 | - m_ImageIndex: 5 61 | m_Position: .435999811 62 | m_Size: 4.01399994 63 | m_Color: {r: .0117647061, g: .0235294122, b: .0392156877, a: 1} 64 | m_UseLightColor: 1 65 | m_Rotate: 0 66 | m_Zoom: 0 67 | m_Fade: 1 68 | - m_ImageIndex: 5 69 | m_Position: .335999876 70 | m_Size: 2.58999991 71 | m_Color: {r: .0352941193, g: .0235294122, b: .0784313753, a: 1} 72 | m_UseLightColor: 1 73 | m_Rotate: 0 74 | m_Zoom: 0 75 | m_Fade: 1 76 | - m_ImageIndex: 5 77 | m_Position: .390999913 78 | m_Size: 7.47000074 79 | m_Color: {r: .0156862754, g: .0235294122, b: .0392156877, a: 1} 80 | m_UseLightColor: 1 81 | m_Rotate: 0 82 | m_Zoom: 0 83 | m_Fade: 1 84 | - m_ImageIndex: 7 85 | m_Position: 1.5 86 | m_Size: 7.47000074 87 | m_Color: {r: .0941176489, g: .0588235296, b: 0, a: 1} 88 | m_UseLightColor: 1 89 | m_Rotate: 0 90 | m_Zoom: 0 91 | m_Fade: 1 92 | - m_ImageIndex: 5 93 | m_Position: 1.45300031 94 | m_Size: 4.44999361 95 | m_Color: {r: .0705882385, g: .0431372561, b: 0, a: 1} 96 | m_UseLightColor: 1 97 | m_Rotate: 0 98 | m_Zoom: 0 99 | m_Fade: 1 100 | - m_ImageIndex: 4 101 | m_Position: 1.28200161 102 | m_Size: 1.5 103 | m_Color: {r: .270588249, g: .819607854, b: .572549045, a: 1} 104 | m_UseLightColor: 1 105 | m_Rotate: 0 106 | m_Zoom: 0 107 | m_Fade: 1 108 | - m_ImageIndex: 6 109 | m_Position: 1.74200153 110 | m_Size: 2.76999307 111 | m_Color: {r: .156862751, g: .0784313753, b: .270588249, a: 1} 112 | m_UseLightColor: 1 113 | m_Rotate: 0 114 | m_Zoom: 0 115 | m_Fade: 1 116 | - m_ImageIndex: 5 117 | m_Position: 1.72300005 118 | m_Size: 2.76999283 119 | m_Color: {r: .0274509806, g: .0941176489, b: .0588235296, a: 1} 120 | m_UseLightColor: 1 121 | m_Rotate: 0 122 | m_Zoom: 0 123 | m_Fade: 1 124 | - m_ImageIndex: 5 125 | m_Position: 1.52300024 126 | m_Size: 2.12999368 127 | m_Color: {r: .0509803928, g: .0313725509, b: 0, a: 1} 128 | m_UseLightColor: 1 129 | m_Rotate: 0 130 | m_Zoom: 0 131 | m_Fade: 1 132 | - m_ImageIndex: 8 133 | m_Position: -.239000008 134 | m_Size: 4.5899992 135 | m_Color: {r: .188235298, g: .149019614, b: .0588235296, a: 1} 136 | m_UseLightColor: 1 137 | m_Rotate: 0 138 | m_Zoom: 0 139 | m_Fade: 1 140 | - m_ImageIndex: 2 141 | m_Position: 2.46099973 142 | m_Size: 25.9699974 143 | m_Color: {r: .164705887, g: .164705887, b: .164705887, a: 1} 144 | m_UseLightColor: 1 145 | m_Rotate: 0 146 | m_Zoom: 0 147 | m_Fade: 1 148 | - m_ImageIndex: 1 149 | m_Position: 2.1309998 150 | m_Size: 17.2099953 151 | m_Color: {r: .164705887, g: .164705887, b: .164705887, a: 1} 152 | m_UseLightColor: 1 153 | m_Rotate: 0 154 | m_Zoom: 0 155 | m_Fade: 1 156 | - m_ImageIndex: 5 157 | m_Position: .819999993 158 | m_Size: 2.65999603 159 | m_Color: {r: .0509803928, g: .0235294122, b: 0, a: 1} 160 | m_UseLightColor: 1 161 | m_Rotate: 0 162 | m_Zoom: 0 163 | m_Fade: 1 164 | m_UseFog: 1 165 | --- !u!1002 &12100001 166 | EditorExtensionImpl: 167 | serializedVersion: 6 168 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/GerstnerDisplaceEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using UnityEditor; 4 | 5 | [CustomEditor(typeof(GerstnerDisplace))] 6 | public class GerstnerDisplaceEditor : Editor 7 | { 8 | private SerializedObject serObj; 9 | 10 | public void OnEnable () 11 | { 12 | serObj = new SerializedObject (target); 13 | } 14 | 15 | public override void OnInspectorGUI () 16 | { 17 | serObj.Update(); 18 | 19 | GameObject go = ((GerstnerDisplace)serObj.targetObject).gameObject; 20 | WaterBase wb = (WaterBase)go.GetComponent(typeof(WaterBase)); 21 | Material sharedWaterMaterial = wb.sharedMaterial; 22 | 23 | GUILayout.Label ("Animates vertices using up 4 generated waves", EditorStyles.miniBoldLabel); 24 | 25 | if(sharedWaterMaterial) 26 | { 27 | Vector4 amplitude = WaterEditorUtility.GetMaterialVector("_GAmplitude", sharedWaterMaterial); 28 | Vector4 frequency = WaterEditorUtility.GetMaterialVector("_GFrequency", sharedWaterMaterial); 29 | Vector4 steepness = WaterEditorUtility.GetMaterialVector("_GSteepness", sharedWaterMaterial); 30 | Vector4 speed = WaterEditorUtility.GetMaterialVector("_GSpeed", sharedWaterMaterial); 31 | Vector4 directionAB = WaterEditorUtility.GetMaterialVector("_GDirectionAB", sharedWaterMaterial); 32 | Vector4 directionCD = WaterEditorUtility.GetMaterialVector("_GDirectionCD", sharedWaterMaterial); 33 | 34 | amplitude = EditorGUILayout.Vector4Field("Amplitude (Height offset)", amplitude); 35 | frequency = EditorGUILayout.Vector4Field("Frequency (Tiling)", frequency); 36 | steepness = EditorGUILayout.Vector4Field("Steepness", steepness); 37 | speed = EditorGUILayout.Vector4Field("Speed", speed); 38 | directionAB = EditorGUILayout.Vector4Field("Direction scale (Wave 1 (X,Y) and 2 (Z,W))", directionAB); 39 | directionCD = EditorGUILayout.Vector4Field("Direction scale (Wave 3 (X,Y) and 4 (Z,W))", directionCD); 40 | 41 | if (GUI.changed) { 42 | WaterEditorUtility.SetMaterialVector("_GAmplitude", amplitude, sharedWaterMaterial); 43 | WaterEditorUtility.SetMaterialVector("_GFrequency", frequency, sharedWaterMaterial); 44 | WaterEditorUtility.SetMaterialVector("_GSteepness", steepness, sharedWaterMaterial); 45 | WaterEditorUtility.SetMaterialVector("_GSpeed", speed, sharedWaterMaterial); 46 | WaterEditorUtility.SetMaterialVector("_GDirectionAB", directionAB, sharedWaterMaterial); 47 | WaterEditorUtility.SetMaterialVector("_GDirectionCD", directionCD, sharedWaterMaterial); 48 | } 49 | 50 | /* 51 | 52 | Vector4 animationTiling = WaterEditorUtility.GetMaterialVector("_AnimationTiling", sharedWaterMaterial); 53 | Vector4 animationDirection = WaterEditorUtility.GetMaterialVector("_AnimationDirection", sharedWaterMaterial); 54 | 55 | float firstTilingU = animationTiling.x*100.0F; 56 | float firstTilingV = animationTiling.y*100.0F; 57 | float firstDirectionU = animationDirection.x; 58 | float firstDirectionV = animationDirection.y; 59 | 60 | float secondTilingU = animationTiling.z*100.0F; 61 | float secondTilingV = animationTiling.w*100.0F; 62 | float secondDirectionU = animationDirection.z; 63 | float secondDirectionV = animationDirection.w; 64 | 65 | 66 | EditorGUILayout.BeginHorizontal (); 67 | firstTilingU = EditorGUILayout.FloatField("First Tiling U", firstTilingU); 68 | firstTilingV = EditorGUILayout.FloatField("First Tiling V", firstTilingV); 69 | EditorGUILayout.EndHorizontal (); 70 | EditorGUILayout.BeginHorizontal (); 71 | secondTilingU = EditorGUILayout.FloatField("Second Tiling U", secondTilingU); 72 | secondTilingV = EditorGUILayout.FloatField("Second Tiling V", secondTilingV); 73 | EditorGUILayout.EndHorizontal (); 74 | 75 | EditorGUILayout.BeginHorizontal (); 76 | firstDirectionU = EditorGUILayout.FloatField("1st Animation U", firstDirectionU); 77 | firstDirectionV = EditorGUILayout.FloatField("1st Animation V", firstDirectionV); 78 | EditorGUILayout.EndHorizontal (); 79 | EditorGUILayout.BeginHorizontal (); 80 | secondDirectionU = EditorGUILayout.FloatField("2nd Animation U", secondDirectionU); 81 | secondDirectionV = EditorGUILayout.FloatField("2nd Animation V", secondDirectionV); 82 | EditorGUILayout.EndHorizontal (); 83 | 84 | animationDirection = new Vector4(firstDirectionU,firstDirectionV, secondDirectionU,secondDirectionV); 85 | animationTiling = new Vector4(firstTilingU/100.0F,firstTilingV/100.0F, secondTilingU/100.0F,secondTilingV/100.0F); 86 | 87 | WaterEditorUtility.SetMaterialVector("_AnimationTiling", animationTiling, sharedWaterMaterial); 88 | WaterEditorUtility.SetMaterialVector("_AnimationDirection", animationDirection, sharedWaterMaterial); 89 | 90 | EditorGUILayout.Separator (); 91 | 92 | GUILayout.Label ("Displacement Strength", EditorStyles.boldLabel); 93 | 94 | float heightDisplacement = WaterEditorUtility.GetMaterialFloat("_HeightDisplacement", sharedWaterMaterial); 95 | 96 | heightDisplacement = EditorGUILayout.Slider("Height", heightDisplacement, 0.0F, 5.0F); 97 | WaterEditorUtility.SetMaterialFloat("_HeightDisplacement", heightDisplacement, sharedWaterMaterial); 98 | */ 99 | } 100 | 101 | serObj.ApplyModifiedProperties(); 102 | } 103 | } -------------------------------------------------------------------------------- /Assets/Scripts/Generator/BlockGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | 6 | public class BlockGenerator : Generator { 7 | public float Height; 8 | public float Width; 9 | public float Depth; 10 | 11 | public TerrainGenerator Terrain; 12 | 13 | private BlockType type; 14 | 15 | public BlockGenerator() { 16 | OpenSize = 100f; 17 | } 18 | 19 | protected override IEnumerable> Open() { 20 | if (Height > 200f) { 21 | this.type = BlockType.Office; 22 | } 23 | else if (Height > 150f) { 24 | float residentialProb = 0.5f; 25 | 26 | if (RandomBernoulli(residentialProb)) { 27 | this.type = BlockType.Residential; 28 | } 29 | else { 30 | this.type = BlockType.Office; 31 | } 32 | } 33 | else if (Height > 100f) { 34 | float residentialProb = 0.33f; 35 | float comercialProb = 0.33f; 36 | 37 | float p = RandomUniform(0, 1); 38 | 39 | if (p <= residentialProb) { 40 | this.type = BlockType.Residential; 41 | } 42 | else if (p <= residentialProb + comercialProb) { 43 | this.type = BlockType.Comercial; 44 | } 45 | else { 46 | this.type = BlockType.Office; 47 | } 48 | } 49 | else if (Height > 50f) { 50 | float residentialProb = 0.5f; 51 | float comercialProb = 0.25f; 52 | 53 | float p = RandomUniform(0, 1); 54 | 55 | if (p <= residentialProb) { 56 | this.type = BlockType.Residential; 57 | } 58 | else if (p <= residentialProb + comercialProb) { 59 | this.type = BlockType.Comercial; 60 | } 61 | else { 62 | this.type = BlockType.Industrial; 63 | } 64 | } 65 | else if (Height > 25f) { 66 | float residentialProb = 0.25f; 67 | float comercialProb = 0.25f; 68 | 69 | float p = RandomUniform(0, 1); 70 | 71 | if (p <= residentialProb) { 72 | this.type = BlockType.Residential; 73 | } 74 | else if (p <= residentialProb + comercialProb) { 75 | this.type = BlockType.Comercial; 76 | } 77 | else { 78 | this.type = BlockType.Industrial; 79 | } 80 | } 81 | else if (Height > 10f) { 82 | float facilityProb = 0.5f; 83 | float p = RandomUniform(0, 1); 84 | 85 | if (p <= facilityProb) { 86 | this.type = BlockType.Facility; 87 | } 88 | else { 89 | this.type = BlockType.Industrial; 90 | } 91 | } 92 | else { 93 | this.type = BlockType.Park; 94 | } 95 | 96 | //var basing = new GameObject("Basing", typeof(MeshRenderer), typeof(MeshFilter)); 97 | var basing = GameObject.CreatePrimitive(PrimitiveType.Cube); 98 | basing.transform.localScale = new Vector3(Width, 1, Depth); 99 | basing.transform.localPosition = Vector3.up * Height / 2f; 100 | basing.renderer.material.shader = Shader.Find("Diffuse"); 101 | //basing.AddComponent().MinVisibleDistance = 3000f; 102 | 103 | switch(this.type) { 104 | case BlockType.Office: 105 | basing.renderer.material.color = Color.white; 106 | break; 107 | case BlockType.Residential: 108 | basing.renderer.material.color = Color.red; 109 | break; 110 | case BlockType.Comercial: 111 | basing.renderer.material.color = Color.blue; 112 | break; 113 | case BlockType.Industrial: 114 | basing.renderer.material.color = Color.magenta; 115 | break; 116 | case BlockType.Facility: 117 | basing.renderer.material.color = Color.yellow; 118 | break; 119 | case BlockType.Park: 120 | basing.renderer.material.color = Color.green; 121 | break; 122 | default: 123 | break; 124 | } 125 | 126 | //var mesh = basing.GetComponent().mesh; 127 | 128 | //var vertices = mesh.vertices; 129 | 130 | //for (int i = 0; i < vertices.Length; i++) { 131 | // var worldVertices = this.transform.TransformPoint(vertices[i]); 132 | // vertices[i] += Terrain.SamplePoint(worldVertices) - worldVertices; 133 | //} 134 | 135 | //mesh.vertices = vertices; 136 | 137 | yield return new Step(basing); 138 | 139 | //var street = GameObject.CreatePrimitive(PrimitiveType.Cube); 140 | //street.transform.localScale = new Vector3(Width + 20, 2, Depth + 20); 141 | //street.AddComponent(); 142 | 143 | //yield return street; 144 | } 145 | 146 | protected override IEnumerable> GenerateChildren() { 147 | if (Terrain != null) { 148 | while (!Terrain.Ready) { 149 | yield return new Step(1f); 150 | } 151 | } 152 | 153 | for(int i=0; i<4; i++) { 154 | for(int j=0; j<4; j++) { 155 | float x = i * 40 - 80 + 20; 156 | float z = j * 40 - 80 + 20; 157 | float h = RandomUniform(Height/2, Height * 0.9f); 158 | 159 | var building = CreateChildren("Building"); 160 | 161 | Vector3 localPosition = new Vector3(x, 0, z); 162 | 163 | if (Terrain != null) { 164 | Vector3 transformedPosition = this.transform.TransformPoint(localPosition); 165 | transformedPosition = Terrain.SamplePoint(transformedPosition); 166 | localPosition = this.transform.InverseTransformPoint(transformedPosition) + Vector3.up * h/2; 167 | 168 | Vector3 normal = Terrain.SampleNormal(transformedPosition, 30f); 169 | 170 | if (transformedPosition.y < 10 || Vector3.Angle(normal, Vector3.up) > 30) { 171 | yield return new Step(); 172 | continue; 173 | } 174 | } 175 | 176 | building.transform.localPosition = localPosition; 177 | 178 | building.Height = h; 179 | building.Width = 30; 180 | building.Depth = 30; 181 | building.Type = type; 182 | 183 | yield return new Step(building); 184 | } 185 | } 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /Assets/Scripts/Generator/TreeGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | 4 | public class TreeGenerator : Generator { 5 | private float height; 6 | private float width; 7 | private float bush; 8 | private GameObject head; 9 | 10 | public int Level = 2; 11 | 12 | public Color BaseColor = new Color32(42, 107, 5, 255); 13 | public float ColorVariation = 0.1f; 14 | 15 | public int BranchSteps = 5; 16 | public int MinBranchingGuide = 3; 17 | public float AngleVariation = 45f; 18 | public float MinHeight = 2f; 19 | public float MaxHeight = 5f; 20 | public int MinBranches = 5; 21 | public int MaxBranches = 10; 22 | 23 | public float LeavesDensity = 1f; 24 | 25 | public Material BarkMaterial; 26 | public Material LeavesMaterial; 27 | 28 | private List guides = new List(); 29 | 30 | protected override IEnumerable> Open() { 31 | height = RandomUniform(MinHeight, MaxHeight); 32 | width = RandomUniform(0.25f, 0.5f); 33 | bush = RandomUniform(5f, 10f); 34 | 35 | guides.Clear(); 36 | 37 | var basing = GameObject.CreatePrimitive(PrimitiveType.Sphere); 38 | basing.transform.localScale = Vector3.one * width * 1.5f; 39 | basing.renderer.sharedMaterial = BarkMaterial; 40 | 41 | yield return new Step(basing); 42 | 43 | var guideRoot = new GameObject("Guide"); 44 | 45 | guides.Add(guideRoot); 46 | 47 | yield return new Step(guideRoot); 48 | 49 | GameObject lastGuide = guideRoot; 50 | 51 | for (int i = 0; i < BranchSteps; i++) { 52 | float angle = RandomUniform(-AngleVariation, AngleVariation); 53 | float baseAngle = RandomUniform(0, 360); 54 | 55 | lastGuide.transform.Rotate(0, baseAngle, angle); 56 | lastGuide.transform.localScale = Vector3.one; 57 | 58 | var body = GameObject.CreatePrimitive(PrimitiveType.Cylinder); 59 | body.renderer.sharedMaterial = BarkMaterial; 60 | body.transform.parent = lastGuide.transform; 61 | body.transform.localScale = new Vector3(width, height / 2 / BranchSteps, width); 62 | body.transform.localPosition = Vector3.up * height / 2 / BranchSteps; 63 | body.transform.localRotation = Quaternion.identity; 64 | 65 | yield return new Step(); 66 | 67 | var top = GameObject.CreatePrimitive(PrimitiveType.Sphere); 68 | top.renderer.sharedMaterial = BarkMaterial; 69 | top.transform.parent = lastGuide.transform; 70 | top.transform.localScale = Vector3.one * width; 71 | top.transform.localPosition = Vector3.up * height / BranchSteps; 72 | top.transform.localRotation = Quaternion.identity; 73 | 74 | yield return new Step(); 75 | 76 | var newGuide = new GameObject("Guide"); 77 | newGuide.transform.parent = lastGuide.transform; 78 | newGuide.transform.localPosition = top.transform.localPosition; 79 | newGuide.transform.localRotation = top.transform.localRotation; 80 | 81 | yield return new Step(); 82 | 83 | guides.Add(newGuide); 84 | 85 | lastGuide = newGuide; 86 | } 87 | 88 | if (RandomBernoulli(LeavesDensity)) { 89 | head = GameObject.CreatePrimitive(PrimitiveType.Sphere); 90 | head.renderer.sharedMaterial = LeavesMaterial; 91 | //head.renderer.material.color = (BaseColor + new Color(RandomUniform(-1, 1) * ColorVariation, RandomUniform(-1, 1) * ColorVariation, RandomUniform(-1, 1) * ColorVariation)); 92 | head.transform.localScale = Vector3.one * width * bush; 93 | head.transform.localPosition = this.transform.InverseTransformPoint(lastGuide.transform.position); 94 | 95 | yield return new Step(head); 96 | 97 | head.transform.rotation = Quaternion.identity; 98 | } 99 | } 100 | 101 | protected override void PostChildrenClose() { 102 | if (head != null) head.SetActive(true); 103 | } 104 | 105 | protected override IEnumerable> GenerateChildren() { 106 | if (Level == 0) { 107 | yield break; 108 | } 109 | 110 | int branches = RandomInteger(MinBranches, MaxBranches); 111 | 112 | Vector3 right = this.transform.TransformDirection(Vector3.right); 113 | Vector3 up = this.transform.TransformDirection(Vector3.up); 114 | 115 | for (int i = 0; i < branches; i++) { 116 | var child = CreateChildren("Branch"); 117 | float childScale = RandomUniform(0.25f, 0.5f); 118 | //child.transform.localPosition = Vector3.up * RandomUniform(0.5f, 1f) * height; 119 | int guideIndex = RandomInteger(MinBranchingGuide, BranchSteps + 1); 120 | child.transform.localPosition = transform.InverseTransformPoint(guides[guideIndex].transform.position); 121 | child.transform.Rotate(right, RandomUniform(30f, 90f), Space.World); 122 | child.transform.Rotate(up, RandomUniform(0f, 360f), Space.World); 123 | child.transform.localScale = Vector3.one * childScale; 124 | child.transform.Translate(Vector3.up * width / 2f * this.transform.localScale.x * childScale); 125 | child.OpenSize = OpenSize; 126 | child.Level = Level - 1; 127 | child.BaseColor = BaseColor; 128 | child.ColorVariation = ColorVariation; 129 | child.BranchSteps = BranchSteps; 130 | child.AngleVariation = AngleVariation; 131 | child.LeavesDensity = LeavesDensity; 132 | child.BarkMaterial = BarkMaterial; 133 | child.LeavesMaterial = LeavesMaterial; 134 | 135 | yield return new Step(child); 136 | } 137 | 138 | if (head != null) head.SetActive(false); 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Sources/Shaders/FX-Water.shader: -------------------------------------------------------------------------------- 1 | Shader "FX/Water" { 2 | Properties { 3 | _WaveScale ("Wave scale", Range (0.02,0.15)) = 0.063 4 | _ReflDistort ("Reflection distort", Range (0,1.5)) = 0.44 5 | _RefrDistort ("Refraction distort", Range (0,1.5)) = 0.40 6 | _RefrColor ("Refraction color", COLOR) = ( .34, .85, .92, 1) 7 | _Fresnel ("Fresnel (A) ", 2D) = "gray" {} 8 | _BumpMap ("Normalmap ", 2D) = "bump" {} 9 | WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7) 10 | _ReflectiveColor ("Reflective color (RGB) fresnel (A) ", 2D) = "" {} 11 | _ReflectiveColorCube ("Reflective color cube (RGB) fresnel (A)", Cube) = "" { TexGen CubeReflect } 12 | _HorizonColor ("Simple water horizon color", COLOR) = ( .172, .463, .435, 1) 13 | _MainTex ("Fallback texture", 2D) = "" {} 14 | _ReflectionTex ("Internal Reflection", 2D) = "" {} 15 | _RefractionTex ("Internal Refraction", 2D) = "" {} 16 | } 17 | 18 | 19 | // ----------------------------------------------------------- 20 | // Fragment program cards 21 | 22 | 23 | Subshader { 24 | Tags { "WaterMode"="Refractive" "RenderType"="Opaque" } 25 | Pass { 26 | CGPROGRAM 27 | #pragma vertex vert 28 | #pragma fragment frag 29 | #pragma fragmentoption ARB_precision_hint_fastest 30 | #pragma multi_compile WATER_REFRACTIVE WATER_REFLECTIVE WATER_SIMPLE 31 | 32 | #if defined (WATER_REFLECTIVE) || defined (WATER_REFRACTIVE) 33 | #define HAS_REFLECTION 1 34 | #endif 35 | #if defined (WATER_REFRACTIVE) 36 | #define HAS_REFRACTION 1 37 | #endif 38 | 39 | 40 | #include "UnityCG.cginc" 41 | 42 | uniform float4 _WaveScale4; 43 | uniform float4 _WaveOffset; 44 | 45 | #if HAS_REFLECTION 46 | uniform float _ReflDistort; 47 | #endif 48 | #if HAS_REFRACTION 49 | uniform float _RefrDistort; 50 | #endif 51 | 52 | struct appdata { 53 | float4 vertex : POSITION; 54 | float3 normal : NORMAL; 55 | }; 56 | 57 | struct v2f { 58 | float4 pos : SV_POSITION; 59 | #if defined(HAS_REFLECTION) || defined(HAS_REFRACTION) 60 | float4 ref : TEXCOORD0; 61 | float2 bumpuv0 : TEXCOORD1; 62 | float2 bumpuv1 : TEXCOORD2; 63 | float3 viewDir : TEXCOORD3; 64 | #else 65 | float2 bumpuv0 : TEXCOORD0; 66 | float2 bumpuv1 : TEXCOORD1; 67 | float3 viewDir : TEXCOORD2; 68 | #endif 69 | 70 | }; 71 | 72 | v2f vert(appdata v) 73 | { 74 | v2f o; 75 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 76 | 77 | // scroll bump waves 78 | float4 temp; 79 | temp.xyzw = v.vertex.xzxz * _WaveScale4 / unity_Scale.w + _WaveOffset; 80 | o.bumpuv0 = temp.xy; 81 | o.bumpuv1 = temp.wz; 82 | 83 | // object space view direction (will normalize per pixel) 84 | o.viewDir.xzy = ObjSpaceViewDir(v.vertex); 85 | 86 | #if defined(HAS_REFLECTION) || defined(HAS_REFRACTION) 87 | o.ref = ComputeScreenPos(o.pos); 88 | #endif 89 | 90 | return o; 91 | } 92 | 93 | #if defined (WATER_REFLECTIVE) || defined (WATER_REFRACTIVE) 94 | sampler2D _ReflectionTex; 95 | #endif 96 | #if defined (WATER_REFLECTIVE) || defined (WATER_SIMPLE) 97 | sampler2D _ReflectiveColor; 98 | #endif 99 | #if defined (WATER_REFRACTIVE) 100 | sampler2D _Fresnel; 101 | sampler2D _RefractionTex; 102 | uniform float4 _RefrColor; 103 | #endif 104 | #if defined (WATER_SIMPLE) 105 | uniform float4 _HorizonColor; 106 | #endif 107 | sampler2D _BumpMap; 108 | 109 | half4 frag( v2f i ) : COLOR 110 | { 111 | i.viewDir = normalize(i.viewDir); 112 | 113 | // combine two scrolling bumpmaps into one 114 | half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv0 )).rgb; 115 | half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv1 )).rgb; 116 | half3 bump = (bump1 + bump2) * 0.5; 117 | 118 | // fresnel factor 119 | half fresnelFac = dot( i.viewDir, bump ); 120 | 121 | // perturb reflection/refraction UVs by bumpmap, and lookup colors 122 | 123 | #if HAS_REFLECTION 124 | float4 uv1 = i.ref; uv1.xy += bump * _ReflDistort; 125 | half4 refl = tex2Dproj( _ReflectionTex, UNITY_PROJ_COORD(uv1) ); 126 | #endif 127 | #if HAS_REFRACTION 128 | float4 uv2 = i.ref; uv2.xy -= bump * _RefrDistort; 129 | half4 refr = tex2Dproj( _RefractionTex, UNITY_PROJ_COORD(uv2) ) * _RefrColor; 130 | #endif 131 | 132 | // final color is between refracted and reflected based on fresnel 133 | half4 color; 134 | 135 | #if defined(WATER_REFRACTIVE) 136 | half fresnel = UNITY_SAMPLE_1CHANNEL( _Fresnel, float2(fresnelFac,fresnelFac) ); 137 | color = lerp( refr, refl, fresnel ); 138 | #endif 139 | 140 | #if defined(WATER_REFLECTIVE) 141 | half4 water = tex2D( _ReflectiveColor, float2(fresnelFac,fresnelFac) ); 142 | color.rgb = lerp( water.rgb, refl.rgb, water.a ); 143 | color.a = refl.a * water.a; 144 | #endif 145 | 146 | #if defined(WATER_SIMPLE) 147 | half4 water = tex2D( _ReflectiveColor, float2(fresnelFac,fresnelFac) ); 148 | color.rgb = lerp( water.rgb, _HorizonColor.rgb, water.a ); 149 | color.a = _HorizonColor.a; 150 | #endif 151 | 152 | return color; 153 | } 154 | ENDCG 155 | 156 | } 157 | } 158 | 159 | // ----------------------------------------------------------- 160 | // Old cards 161 | 162 | // three texture, cubemaps 163 | Subshader { 164 | Tags { "WaterMode"="Simple" "RenderType"="Opaque" } 165 | Pass { 166 | Color (0.5,0.5,0.5,0.5) 167 | SetTexture [_MainTex] { 168 | Matrix [_WaveMatrix] 169 | combine texture * primary 170 | } 171 | SetTexture [_MainTex] { 172 | Matrix [_WaveMatrix2] 173 | combine texture * primary + previous 174 | } 175 | SetTexture [_ReflectiveColorCube] { 176 | combine texture +- previous, primary 177 | Matrix [_Reflection] 178 | } 179 | } 180 | } 181 | 182 | // dual texture, cubemaps 183 | Subshader { 184 | Tags { "WaterMode"="Simple" "RenderType"="Opaque" } 185 | Pass { 186 | Color (0.5,0.5,0.5,0.5) 187 | SetTexture [_MainTex] { 188 | Matrix [_WaveMatrix] 189 | combine texture 190 | } 191 | SetTexture [_ReflectiveColorCube] { 192 | combine texture +- previous, primary 193 | Matrix [_Reflection] 194 | } 195 | } 196 | } 197 | 198 | // single texture 199 | Subshader { 200 | Tags { "WaterMode"="Simple" "RenderType"="Opaque" } 201 | Pass { 202 | Color (0.5,0.5,0.5,0) 203 | SetTexture [_MainTex] { 204 | Matrix [_WaveMatrix] 205 | combine texture, primary 206 | } 207 | } 208 | } 209 | 210 | 211 | } 212 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Materials/Water4ExampleSimple.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Water4ExampleSimple 10 | m_Shader: {fileID: 4800000, guid: 8aaff0751054e4a9cb4642d01eaf5be9, type: 3} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: e6f8288974c664a309d6c66de636978c, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 2800000, guid: fb6566c21f717904f83743a5a76dd0b0, type: 3} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | data: 31 | first: 32 | name: _ReflectionTex 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | data: 38 | first: 39 | name: _RefractionTex 40 | second: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | data: 45 | first: 46 | name: _ShoreTex 47 | second: 48 | m_Texture: {fileID: 2800000, guid: 36dd0b22da8874ed38075789055ca664, type: 3} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | data: 52 | first: 53 | name: _WavesTex 54 | second: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | data: 59 | first: 60 | name: _DisplacementHeightMap 61 | second: 62 | m_Texture: {fileID: 2800000, guid: a782b26d6436b48d9882906b9f8ca31a, type: 2} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | data: 66 | first: 67 | name: _SecondDisplacementHeightMap 68 | second: 69 | m_Texture: {fileID: 2800000, guid: 4facc21e08e3a43ed97c930f7dae6e7b, type: 2} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | data: 73 | first: 74 | name: _ThirdDisplacementHeightMap 75 | second: 76 | m_Texture: {fileID: 2800000, guid: dc30b984e8e3c4cdfb38d5fceb411602, type: 2} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | data: 80 | first: 81 | name: _CubeTex 82 | second: 83 | m_Texture: {fileID: 0} 84 | m_Scale: {x: 1, y: 1} 85 | m_Offset: {x: 0, y: 0} 86 | m_Floats: 87 | data: 88 | first: 89 | name: _Shininess 90 | second: 349.137939 91 | data: 92 | first: 93 | name: _FresnelScale 94 | second: .389714301 95 | data: 96 | first: 97 | name: _HeightDisplacement 98 | second: 2.33703184 99 | data: 100 | first: 101 | name: _NormalsDisplacement 102 | second: 72.7272797 103 | m_Colors: 104 | data: 105 | first: 106 | name: _Color 107 | second: {r: 1, g: 1, b: 1, a: 1} 108 | data: 109 | first: 110 | name: _DistortParams 111 | second: {r: 1.02857149, g: .201872215, b: 2.76662493, a: -.417142838} 112 | data: 113 | first: 114 | name: _InvFadeParemeter 115 | second: {r: .275081277, g: .0856210217, b: .0941423923, a: .480310023} 116 | data: 117 | first: 118 | name: _AnimationTiling 119 | second: {r: .400000006, g: .390999973, b: .560000002, a: .699999988} 120 | data: 121 | first: 122 | name: _AnimationDirection 123 | second: {r: 2, g: 1, b: -1, a: 1} 124 | data: 125 | first: 126 | name: _BumpTiling 127 | second: {r: .0399999991, g: .0399999991, b: .0399999991, a: .0799999982} 128 | data: 129 | first: 130 | name: _BumpDirection 131 | second: {r: 1, g: 30, b: 20, a: -20} 132 | data: 133 | first: 134 | name: _BaseColor 135 | second: {r: .172755614, g: .224076003, b: .24626863, a: .505882382} 136 | data: 137 | first: 138 | name: _ReflectionColor 139 | second: {r: .47582978, g: .606486499, b: .664179087, a: .470588237} 140 | data: 141 | first: 142 | name: _SpecularColor 143 | second: {r: .820895553, g: .805815935, b: .771886885, a: 1} 144 | data: 145 | first: 146 | name: _WorldLightDir 147 | second: {r: .0139923692, g: -.173590809, b: -.984718621, a: 0} 148 | data: 149 | first: 150 | name: _GAmplitude 151 | second: {r: .300000012, g: .200000003, b: .25, a: .25} 152 | data: 153 | first: 154 | name: _GFrequency 155 | second: {r: .5, g: .25, b: .600000024, a: .245000005} 156 | data: 157 | first: 158 | name: _GSteepness 159 | second: {r: 3.03013062, g: 1, b: 1, a: 1} 160 | data: 161 | first: 162 | name: _GSpeed 163 | second: {r: 4, g: 2, b: 1, a: 1} 164 | data: 165 | first: 166 | name: _GDirectionAB 167 | second: {r: .850000024, g: .300000012, b: .25, a: .25} 168 | data: 169 | first: 170 | name: _GDirectionCD 171 | second: {r: -.300000012, g: -.899999976, b: .5, a: .5} 172 | data: 173 | first: 174 | name: _Foam 175 | second: {r: .327586204, g: .7471264, b: 0, a: 0} 176 | data: 177 | first: 178 | name: _DepthColor 179 | second: {r: .298117638, g: .366117179, b: .395522416, a: .345098048} 180 | data: 181 | first: 182 | name: _RefractionFog 183 | second: {r: .868177772, g: .879717588, b: .888059676, a: 1} 184 | --- !u!1002 &2100001 185 | EditorExtensionImpl: 186 | serializedVersion: 6 187 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: .00100000005 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: .00100000005 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: .00100000005 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: .00100000005 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left cmd 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: .00100000005 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: .00100000005 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: .100000001 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: .100000001 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: .100000001 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: .189999998 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: .189999998 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: .00100000005 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: .00100000005 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: .00100000005 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: .00100000005 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: .00100000005 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: .00100000005 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: .00100000005 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | AndroidProfiler: 0 8 | defaultScreenOrientation: 0 9 | targetDevice: 2 10 | targetGlesGraphics: 1 11 | targetResolution: 0 12 | accelerometerFrequency: 60 13 | companyName: apiad.net 14 | productName: pcg 15 | defaultCursor: {fileID: 0} 16 | cursorHotspot: {x: 0, y: 0} 17 | defaultScreenWidth: 1024 18 | defaultScreenHeight: 768 19 | defaultScreenWidthWeb: 960 20 | defaultScreenHeightWeb: 600 21 | m_RenderingPath: 1 22 | m_MobileRenderingPath: 1 23 | m_ActiveColorSpace: 0 24 | m_MTRendering: 1 25 | m_MobileMTRendering: 0 26 | m_UseDX11: 0 27 | m_Stereoscopic3D: 0 28 | iosShowActivityIndicatorOnLoading: -1 29 | androidShowActivityIndicatorOnLoading: -1 30 | displayResolutionDialog: 2 31 | allowedAutorotateToPortrait: 1 32 | allowedAutorotateToPortraitUpsideDown: 1 33 | allowedAutorotateToLandscapeRight: 1 34 | allowedAutorotateToLandscapeLeft: 1 35 | useOSAutorotation: 1 36 | use32BitDisplayBuffer: 1 37 | use24BitDepthBuffer: 1 38 | defaultIsFullScreen: 1 39 | defaultIsNativeResolution: 1 40 | runInBackground: 1 41 | captureSingleScreen: 0 42 | Override IPod Music: 0 43 | Prepare IOS For Recording: 0 44 | enableHWStatistics: 1 45 | usePlayerLog: 1 46 | stripPhysics: 0 47 | forceSingleInstance: 0 48 | resizableWindow: 0 49 | useMacAppStoreValidation: 0 50 | gpuSkinning: 0 51 | xboxPIXTextureCapture: 0 52 | xboxEnableAvatar: 0 53 | xboxEnableKinect: 0 54 | xboxEnableKinectAutoTracking: 0 55 | xboxEnableFitness: 0 56 | visibleInBackground: 0 57 | macFullscreenMode: 2 58 | d3d9FullscreenMode: 1 59 | d3d11ForceExclusiveMode: 0 60 | xboxSpeechDB: 0 61 | xboxEnableHeadOrientation: 0 62 | xboxEnableGuest: 0 63 | videoMemoryForVertexBuffers: 0 64 | m_SupportedAspectRatios: 65 | 4:3: 1 66 | 5:4: 1 67 | 16:10: 1 68 | 16:9: 1 69 | Others: 1 70 | iPhoneBundleIdentifier: net.apiad.pcg 71 | metroEnableIndependentInputSource: 0 72 | metroEnableLowLatencyPresentationAPI: 0 73 | productGUID: c1fca14c527ef124d87313805f2f6d75 74 | iPhoneBundleVersion: 1.0 75 | AndroidBundleVersionCode: 1 76 | AndroidMinSdkVersion: 9 77 | AndroidPreferredInstallLocation: 1 78 | aotOptions: 79 | apiCompatibilityLevel: 2 80 | iPhoneStrippingLevel: 0 81 | iPhoneScriptCallOptimization: 0 82 | ForceInternetPermission: 0 83 | ForceSDCardPermission: 0 84 | CreateWallpaper: 0 85 | APKExpansionFiles: 0 86 | StripUnusedMeshComponents: 0 87 | iPhoneSdkVersion: 988 88 | iPhoneTargetOSVersion: 16 89 | uIPrerenderedIcon: 0 90 | uIRequiresPersistentWiFi: 0 91 | uIStatusBarHidden: 1 92 | uIExitOnSuspend: 0 93 | uIStatusBarStyle: 0 94 | iPhoneSplashScreen: {fileID: 0} 95 | iPhoneHighResSplashScreen: {fileID: 0} 96 | iPhoneTallHighResSplashScreen: {fileID: 0} 97 | iPhone47inSplashScreen: {fileID: 0} 98 | iPhone55inPortraitSplashScreen: {fileID: 0} 99 | iPhone55inLandscapeSplashScreen: {fileID: 0} 100 | iPadPortraitSplashScreen: {fileID: 0} 101 | iPadHighResPortraitSplashScreen: {fileID: 0} 102 | iPadLandscapeSplashScreen: {fileID: 0} 103 | iPadHighResLandscapeSplashScreen: {fileID: 0} 104 | AndroidTargetDevice: 0 105 | AndroidSplashScreenScale: 0 106 | AndroidKeystoreName: 107 | AndroidKeyaliasName: 108 | resolutionDialogBanner: {fileID: 0} 109 | m_BuildTargetIcons: 110 | - m_BuildTarget: 111 | m_Icons: 112 | - m_Icon: {fileID: 0} 113 | m_Size: 128 114 | m_BuildTargetBatching: [] 115 | webPlayerTemplate: APPLICATION:Default 116 | m_TemplateCustomTags: {} 117 | locationUsageDescription: 118 | XboxTitleId: 119 | XboxImageXexPath: 120 | XboxSpaPath: 121 | XboxGenerateSpa: 0 122 | XboxDeployKinectResources: 0 123 | XboxSplashScreen: {fileID: 0} 124 | xboxEnableSpeech: 0 125 | xboxAdditionalTitleMemorySize: 0 126 | xboxDeployKinectHeadOrientation: 0 127 | xboxDeployKinectHeadPosition: 0 128 | ps3TitleConfigPath: 129 | ps3DLCConfigPath: 130 | ps3ThumbnailPath: 131 | ps3BackgroundPath: 132 | ps3SoundPath: 133 | ps3TrophyCommId: 134 | ps3NpCommunicationPassphrase: 135 | ps3TrophyPackagePath: 136 | ps3BootCheckMaxSaveGameSizeKB: 128 137 | ps3TrophyCommSig: 138 | ps3SaveGameSlots: 1 139 | ps3TrialMode: 0 140 | psp2Splashimage: {fileID: 0} 141 | psp2LiveAreaGate: {fileID: 0} 142 | psp2LiveAreaBackround: {fileID: 0} 143 | psp2NPTrophyPackPath: 144 | psp2NPCommsID: 145 | psp2NPCommsPassphrase: 146 | psp2NPCommsSig: 147 | psp2ParamSfxPath: 148 | psp2PackagePassword: 149 | psp2DLCConfigPath: 150 | psp2ThumbnailPath: 151 | psp2BackgroundPath: 152 | psp2SoundPath: 153 | psp2TrophyCommId: 154 | psp2TrophyPackagePath: 155 | psp2PackagedResourcesPath: 156 | flashStrippingLevel: 2 157 | spritePackerPolicy: 158 | scriptingDefineSymbols: {} 159 | metroPackageName: PCG 160 | metroPackageLogo: 161 | metroPackageLogo140: 162 | metroPackageLogo180: 163 | metroPackageLogo240: 164 | metroPackageVersion: 165 | metroCertificatePath: 166 | metroCertificatePassword: 167 | metroCertificateSubject: 168 | metroCertificateIssuer: 169 | metroCertificateNotAfter: 0000000000000000 170 | metroApplicationDescription: PCG 171 | metroStoreTileLogo80: 172 | metroStoreTileLogo: 173 | metroStoreTileLogo140: 174 | metroStoreTileLogo180: 175 | metroStoreTileWideLogo80: 176 | metroStoreTileWideLogo: 177 | metroStoreTileWideLogo140: 178 | metroStoreTileWideLogo180: 179 | metroStoreTileSmallLogo80: 180 | metroStoreTileSmallLogo: 181 | metroStoreTileSmallLogo140: 182 | metroStoreTileSmallLogo180: 183 | metroStoreSmallTile80: 184 | metroStoreSmallTile: 185 | metroStoreSmallTile140: 186 | metroStoreSmallTile180: 187 | metroStoreLargeTile80: 188 | metroStoreLargeTile: 189 | metroStoreLargeTile140: 190 | metroStoreLargeTile180: 191 | metroStoreSplashScreenImage: 192 | metroStoreSplashScreenImage140: 193 | metroStoreSplashScreenImage180: 194 | metroPhoneAppIcon: 195 | metroPhoneAppIcon140: 196 | metroPhoneAppIcon240: 197 | metroPhoneSmallTile: 198 | metroPhoneSmallTile140: 199 | metroPhoneSmallTile240: 200 | metroPhoneMediumTile: 201 | metroPhoneMediumTile140: 202 | metroPhoneMediumTile240: 203 | metroPhoneWideTile: 204 | metroPhoneWideTile140: 205 | metroPhoneWideTile240: 206 | metroPhoneSplashScreenImage: 207 | metroPhoneSplashScreenImage140: 208 | metroPhoneSplashScreenImage240: 209 | metroTileShortName: 210 | metroCommandLineArgsFile: 211 | metroTileShowName: 1 212 | metroMediumTileShowName: 0 213 | metroLargeTileShowName: 0 214 | metroWideTileShowName: 0 215 | metroDefaultTileSize: 1 216 | metroTileForegroundText: 1 217 | metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 218 | metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 219 | metroSplashScreenUseBackgroundColor: 0 220 | metroCapabilities: {} 221 | metroUnprocessedPlugins: [] 222 | metroCompilationOverrides: 1 223 | blackberryDeviceAddress: 224 | blackberryDevicePassword: 225 | blackberryTokenPath: 226 | blackberryTokenExires: 227 | blackberryTokenAuthor: 228 | blackberryTokenAuthorId: 229 | blackberryAuthorId: 230 | blackberryCskPassword: 231 | blackberrySaveLogPath: 232 | blackberryAuthorIdOveride: 0 233 | blackberrySharedPermissions: 0 234 | blackberryCameraPermissions: 0 235 | blackberryGPSPermissions: 0 236 | blackberryDeviceIDPermissions: 0 237 | blackberryMicrophonePermissions: 0 238 | blackberryGamepadSupport: 0 239 | blackberryBuildId: 0 240 | blackberryLandscapeSplashScreen: {fileID: 0} 241 | blackberryPortraitSplashScreen: {fileID: 0} 242 | blackberrySquareSplashScreen: {fileID: 0} 243 | tizenProductDescription: 244 | tizenProductURL: 245 | tizenCertificatePath: 246 | tizenCertificatePassword: 247 | tizenGPSPermissions: 0 248 | tizenMicrophonePermissions: 0 249 | stvDeviceAddress: 250 | wp8UnprocessedPlugins: [] 251 | firstStreamedLevelWithResources: 0 252 | unityRebuildLibraryVersion: 9 253 | unityForwardCompatibleVersion: 39 254 | unityStandardAssetsVersion: 0 255 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Scripts/PlanarReflection.cs: -------------------------------------------------------------------------------- 1 | 2 | using UnityEngine; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | [ExecuteInEditMode] 7 | [RequireComponent(typeof(WaterBase))] 8 | public class PlanarReflection : MonoBehaviour 9 | { 10 | // reflection 11 | public LayerMask reflectionMask; 12 | public bool reflectSkybox = false; 13 | public Color clearColor = Color.grey; 14 | public System.String reflectionSampler = "_ReflectionTex"; 15 | 16 | // height 17 | public float clipPlaneOffset = 0.07F; 18 | 19 | private Vector3 oldpos = Vector3.zero; 20 | private Camera reflectionCamera; 21 | private Material sharedMaterial = null; 22 | private Dictionary helperCameras = null; 23 | 24 | public void Start () 25 | { 26 | sharedMaterial = ((WaterBase)gameObject.GetComponent(typeof(WaterBase))).sharedMaterial; 27 | } 28 | 29 | private Camera CreateReflectionCameraFor(Camera cam) 30 | { 31 | System.String reflName = gameObject.name+"Reflection"+cam.name; 32 | GameObject go = GameObject.Find(reflName); 33 | 34 | if(!go) 35 | go = new GameObject(reflName, typeof(Camera)); 36 | if(!go.GetComponent(typeof(Camera))) 37 | go.AddComponent(typeof(Camera)); 38 | Camera reflectCamera = go.camera; 39 | 40 | reflectCamera.backgroundColor = clearColor; 41 | reflectCamera.clearFlags = reflectSkybox ? CameraClearFlags.Skybox : CameraClearFlags.SolidColor; 42 | 43 | SetStandardCameraParameter(reflectCamera,reflectionMask); 44 | 45 | if(!reflectCamera.targetTexture) 46 | reflectCamera.targetTexture = CreateTextureFor(cam); 47 | 48 | return reflectCamera; 49 | } 50 | 51 | private void SetStandardCameraParameter(Camera cam, LayerMask mask) 52 | { 53 | cam.cullingMask = mask & ~(1<(); 69 | 70 | if(!helperCameras.ContainsKey(currentCam)) { 71 | helperCameras.Add(currentCam, false); 72 | } 73 | if(helperCameras[currentCam]) { 74 | return; 75 | } 76 | 77 | if(!reflectionCamera) 78 | reflectionCamera = CreateReflectionCameraFor(currentCam); 79 | 80 | RenderReflectionFor(currentCam, reflectionCamera); 81 | 82 | helperCameras[currentCam] = true; 83 | } 84 | 85 | public void LateUpdate () 86 | { 87 | if (null != helperCameras) 88 | helperCameras.Clear(); 89 | } 90 | 91 | public void WaterTileBeingRendered (Transform tr, Camera currentCam) 92 | { 93 | RenderHelpCameras(currentCam); 94 | 95 | if(reflectionCamera && sharedMaterial) { 96 | sharedMaterial.SetTexture(reflectionSampler, reflectionCamera.targetTexture); 97 | } 98 | } 99 | 100 | public void OnEnable() 101 | { 102 | Shader.EnableKeyword("WATER_REFLECTIVE"); 103 | Shader.DisableKeyword("WATER_SIMPLE"); 104 | } 105 | 106 | public void OnDisable() 107 | { 108 | Shader.EnableKeyword("WATER_SIMPLE"); 109 | Shader.DisableKeyword("WATER_REFLECTIVE"); 110 | } 111 | 112 | 113 | private void RenderReflectionFor (Camera cam, Camera reflectCamera) 114 | { 115 | if(!reflectCamera) 116 | return; 117 | 118 | if(sharedMaterial && !sharedMaterial.HasProperty(reflectionSampler)) { 119 | return; 120 | } 121 | 122 | reflectCamera.cullingMask = reflectionMask & ~(1< 0.0F) return 1.0F; 229 | if (a < 0.0F) return -1.0F; 230 | return 0.0F; 231 | } 232 | 233 | private Vector4 CameraSpacePlane (Camera cam, Vector3 pos, Vector3 normal, float sideSign) 234 | { 235 | Vector3 offsetPos = pos + normal * clipPlaneOffset; 236 | Matrix4x4 m = cam.worldToCameraMatrix; 237 | Vector3 cpos = m.MultiplyPoint (offsetPos); 238 | Vector3 cnormal = m.MultiplyVector (normal).normalized * sideSign; 239 | 240 | return new Vector4 (cnormal.x, cnormal.y, cnormal.z, -Vector3.Dot (cpos,cnormal)); 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /Assets/Resources/Water/Water4/Sources/Shaders/WaterInclude.cginc: -------------------------------------------------------------------------------- 1 | 2 | #ifndef WATER_CG_INCLUDED 3 | #define WATER_CG_INCLUDED 4 | 5 | #include "UnityCG.cginc" 6 | 7 | half _GerstnerIntensity; 8 | 9 | inline half3 PerPixelNormal(sampler2D bumpMap, half4 coords, half3 vertexNormal, half bumpStrength) 10 | { 11 | half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); 12 | bump.xy = bump.wy - half2(1.0, 1.0); 13 | half3 worldNormal = vertexNormal + bump.xxy * bumpStrength * half3(1,0,1); 14 | return normalize(worldNormal); 15 | } 16 | 17 | inline half3 PerPixelNormalUnpacked(sampler2D bumpMap, half4 coords, half bumpStrength) 18 | { 19 | half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); 20 | bump = bump * 0.5; 21 | half3 normal = UnpackNormal(bump); 22 | normal.xy *= bumpStrength; 23 | return normalize(normal); 24 | } 25 | 26 | inline half3 GetNormal(half4 tf) { 27 | #ifdef WATER_VERTEX_DISPLACEMENT_ON 28 | return half3(2,1,2) * tf.rbg - half3(1,0,1); 29 | #else 30 | return half3(0,1,0); 31 | #endif 32 | } 33 | 34 | inline half GetDistanceFadeout(half screenW, half speed) { 35 | return 1.0f / abs(0.5f + screenW * speed); 36 | } 37 | 38 | half4 GetDisplacement3(half4 tileableUv, half4 tiling, half4 directionSpeed, sampler2D mapA, sampler2D mapB, sampler2D mapC) 39 | { 40 | half4 displacementUv = tileableUv * tiling + _Time.xxxx * directionSpeed; 41 | #ifdef WATER_VERTEX_DISPLACEMENT_ON 42 | half4 tf = tex2Dlod(mapA, half4(displacementUv.xy, 0.0,0.0)); 43 | tf += tex2Dlod(mapB, half4(displacementUv.zw, 0.0,0.0)); 44 | tf += tex2Dlod(mapC, half4(displacementUv.xw, 0.0,0.0)); 45 | tf *= 0.333333; 46 | #else 47 | half4 tf = half4(0.5,0.5,0.5,0.0); 48 | #endif 49 | 50 | return tf; 51 | } 52 | 53 | half4 GetDisplacement2(half4 tileableUv, half4 tiling, half4 directionSpeed, sampler2D mapA, sampler2D mapB) 54 | { 55 | half4 displacementUv = tileableUv * tiling + _Time.xxxx * directionSpeed; 56 | #ifdef WATER_VERTEX_DISPLACEMENT_ON 57 | half4 tf = tex2Dlod(mapA, half4(displacementUv.xy, 0.0,0.0)); 58 | tf += tex2Dlod(mapB, half4(displacementUv.zw, 0.0,0.0)); 59 | tf *= 0.5; 60 | #else 61 | half4 tf = half4(0.5,0.5,0.5,0.0); 62 | #endif 63 | 64 | return tf; 65 | } 66 | 67 | inline void ComputeScreenAndGrabPassPos (float4 pos, out float4 screenPos, out float4 grabPassPos) 68 | { 69 | #if UNITY_UV_STARTS_AT_TOP 70 | float scale = -1.0; 71 | #else 72 | float scale = 1.0f; 73 | #endif 74 | 75 | screenPos = ComputeScreenPos(pos); 76 | grabPassPos.xy = ( float2( pos.x, pos.y*scale ) + pos.w ) * 0.5; 77 | grabPassPos.zw = pos.zw; 78 | } 79 | 80 | 81 | inline half3 PerPixelNormalUnpacked(sampler2D bumpMap, half4 coords, half bumpStrength, half2 perVertxOffset) 82 | { 83 | half4 bump = tex2D(bumpMap, coords.xy) + tex2D(bumpMap, coords.zw); 84 | bump = bump * 0.5; 85 | half3 normal = UnpackNormal(bump); 86 | normal.xy *= bumpStrength; 87 | normal.xy += perVertxOffset; 88 | return normalize(normal); 89 | } 90 | 91 | inline half3 PerPixelNormalLite(sampler2D bumpMap, half4 coords, half3 vertexNormal, half bumpStrength) 92 | { 93 | half4 bump = tex2D(bumpMap, coords.xy); 94 | bump.xy = bump.wy - half2(0.5, 0.5); 95 | half3 worldNormal = vertexNormal + bump.xxy * bumpStrength * half3(1,0,1); 96 | return normalize(worldNormal); 97 | } 98 | 99 | inline half4 Foam(sampler2D shoreTex, half4 coords, half amount) 100 | { 101 | half4 foam = ( tex2D(shoreTex, coords.xy) * tex2D(shoreTex,coords.zw) ) - 0.125; 102 | foam.a = amount; 103 | return foam; 104 | } 105 | 106 | inline half4 Foam(sampler2D shoreTex, half4 coords) 107 | { 108 | half4 foam = (tex2D(shoreTex, coords.xy) * tex2D(shoreTex,coords.zw)) - 0.125; 109 | return foam; 110 | } 111 | 112 | inline half Fresnel(half3 viewVector, half3 worldNormal, half bias, half power) 113 | { 114 | half facing = clamp(1.0-max(dot(-viewVector, worldNormal), 0.0), 0.0,1.0); 115 | half refl2Refr = saturate(bias+(1.0-bias) * pow(facing,power)); 116 | return refl2Refr; 117 | } 118 | 119 | inline half FresnelViaTexture(half3 viewVector, half3 worldNormal, sampler2D fresnel) 120 | { 121 | half facing = saturate(dot(-viewVector, worldNormal)); 122 | half fresn = tex2D(fresnel, half2(facing, 0.5f)).b; 123 | return fresn; 124 | } 125 | 126 | inline half2 GetTileableUv(half4 vertex) 127 | { 128 | // @NOTE: use worldSpaceVertex.xz instead of ws to make it rotation independent 129 | half2 ws = half2(_Object2World[0][3],_Object2World[2][3]); 130 | half2 tileableUv = (ws + vertex.xz/unity_Scale.w); 131 | return tileableUv; 132 | } 133 | 134 | inline void VertexDisplacementHQ( sampler2D mapA, sampler2D mapB, 135 | sampler2D mapC, half4 uv, 136 | half vertexStrength, half3 normal, 137 | out half4 vertexOffset, out half2 normalOffset) 138 | { 139 | half4 tf = tex2Dlod(mapA, half4(uv.xy, 0.0,0.0)); 140 | tf += tex2Dlod(mapB, half4(uv.zw, 0.0,0.0)); 141 | tf += tex2Dlod(mapC, half4(uv.xw, 0.0,0.0)); 142 | tf /= 3.0; 143 | 144 | tf.rga = tf.rga-half3(0.5,0.5,0.0); 145 | 146 | // height displacement in alpha channel, normals info in rgb 147 | 148 | vertexOffset = tf.a * half4(normal.xyz, 0.0) * vertexStrength; 149 | normalOffset = tf.rg; 150 | } 151 | 152 | inline void VertexDisplacementLQ( sampler2D mapA, sampler2D mapB, 153 | sampler2D mapC, half4 uv, 154 | half vertexStrength, half normalsStrength, 155 | out half4 vertexOffset, out half2 normalOffset) 156 | { 157 | // @NOTE: for best performance, this should really be properly packed! 158 | 159 | half4 tf = tex2Dlod(mapA, half4(uv.xy, 0.0,0.0)); 160 | tf += tex2Dlod(mapB, half4(uv.zw, 0.0,0.0)); 161 | tf *= 0.5; 162 | 163 | tf.rga = tf.rga-half3(0.5,0.5,0.0); 164 | 165 | // height displacement in alpha channel, normals info in rgb 166 | 167 | vertexOffset = tf.a * half4(0,1,0,0) * vertexStrength; 168 | normalOffset = tf.rg * normalsStrength; 169 | } 170 | 171 | half4 ExtinctColor (half4 baseColor, half extinctionAmount) 172 | { 173 | // tweak the extinction coefficient for different coloring 174 | return baseColor - extinctionAmount * half4(0.15, 0.03, 0.01, 0.0); 175 | } 176 | 177 | half3 GerstnerOffsets (half2 xzVtx, half steepness, half amp, half freq, half speed, half2 dir) 178 | { 179 | half3 offsets; 180 | 181 | offsets.x = 182 | steepness * amp * dir.x * 183 | cos( freq * dot( dir, xzVtx ) + speed * _Time.x); 184 | 185 | offsets.z = 186 | steepness * amp * dir.y * 187 | cos( freq * dot( dir, xzVtx ) + speed * _Time.x); 188 | 189 | offsets.y = 190 | amp * sin ( freq * dot( dir, xzVtx ) + speed * _Time.x); 191 | 192 | return offsets; 193 | } 194 | 195 | half3 GerstnerOffset4 (half2 xzVtx, half4 steepness, half4 amp, half4 freq, half4 speed, half4 dirAB, half4 dirCD) 196 | { 197 | half3 offsets; 198 | 199 | half4 AB = steepness.xxyy * amp.xxyy * dirAB.xyzw; 200 | half4 CD = steepness.zzww * amp.zzww * dirCD.xyzw; 201 | 202 | half4 dotABCD = freq.xyzw * half4(dot(dirAB.xy, xzVtx), dot(dirAB.zw, xzVtx), dot(dirCD.xy, xzVtx), dot(dirCD.zw, xzVtx)); 203 | half4 TIME = _Time.yyyy * speed; 204 | 205 | half4 COS = cos (dotABCD + TIME); 206 | half4 SIN = sin (dotABCD + TIME); 207 | 208 | offsets.x = dot(COS, half4(AB.xz, CD.xz)); 209 | offsets.z = dot(COS, half4(AB.yw, CD.yw)); 210 | offsets.y = dot(SIN, amp); 211 | 212 | return offsets; 213 | } 214 | 215 | half3 GerstnerNormal (half2 xzVtx, half steepness, half amp, half freq, half speed, half2 dir) 216 | { 217 | half3 nrml = half3(0,0,0); 218 | 219 | nrml.x -= 220 | dir.x * (amp * freq) * 221 | cos(freq * dot( dir, xzVtx ) + speed * _Time.x); 222 | 223 | nrml.z -= 224 | dir.y * (amp * freq) * 225 | cos(freq * dot( dir, xzVtx ) + speed * _Time.x); 226 | 227 | return nrml; 228 | } 229 | 230 | half3 GerstnerNormal4 (half2 xzVtx, half4 amp, half4 freq, half4 speed, half4 dirAB, half4 dirCD) 231 | { 232 | half3 nrml = half3(0,2.0,0); 233 | 234 | half4 AB = freq.xxyy * amp.xxyy * dirAB.xyzw; 235 | half4 CD = freq.zzww * amp.zzww * dirCD.xyzw; 236 | 237 | half4 dotABCD = freq.xyzw * half4(dot(dirAB.xy, xzVtx), dot(dirAB.zw, xzVtx), dot(dirCD.xy, xzVtx), dot(dirCD.zw, xzVtx)); 238 | half4 TIME = _Time.yyyy * speed; 239 | 240 | half4 COS = cos (dotABCD + TIME); 241 | 242 | nrml.x -= dot(COS, half4(AB.xz, CD.xz)); 243 | nrml.z -= dot(COS, half4(AB.yw, CD.yw)); 244 | 245 | nrml.xz *= _GerstnerIntensity; 246 | nrml = normalize (nrml); 247 | 248 | return nrml; 249 | } 250 | 251 | void Gerstner ( out half3 offs, out half3 nrml, 252 | half3 vtx, half3 tileableVtx, 253 | half4 amplitude, half4 frequency, half4 steepness, 254 | half4 speed, half4 directionAB, half4 directionCD ) 255 | { 256 | #ifdef WATER_VERTEX_DISPLACEMENT_ON 257 | offs = GerstnerOffset4(tileableVtx.xz, steepness, amplitude, frequency, speed, directionAB, directionCD); 258 | nrml = GerstnerNormal4(tileableVtx.xz + offs.xz, amplitude, frequency, speed, directionAB, directionCD); 259 | #else 260 | offs = half3(0,0,0); 261 | nrml = half3(0,1,0); 262 | #endif 263 | } 264 | 265 | 266 | #endif 267 | -------------------------------------------------------------------------------- /Assets/Editor/Water (Pro Only)/Water4/WaterBaseEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | [CustomEditor(typeof(WaterBase))] 5 | public class WaterBaseEditor : Editor 6 | { 7 | public GameObject oceanBase; 8 | private WaterBase waterBase; 9 | private Material oceanMaterial = null; 10 | 11 | private SerializedObject serObj; 12 | private SerializedProperty sharedMaterial; 13 | 14 | 15 | public SerializedProperty waterQuality; 16 | public SerializedProperty edgeBlend; 17 | 18 | public void OnEnable () 19 | { 20 | serObj = new SerializedObject (target); 21 | sharedMaterial = serObj.FindProperty("sharedMaterial"); 22 | waterQuality = serObj.FindProperty("waterQuality"); 23 | edgeBlend = serObj.FindProperty("edgeBlend"); 24 | } 25 | 26 | public override void OnInspectorGUI () 27 | { 28 | serObj.Update(); 29 | 30 | waterBase = (WaterBase)serObj.targetObject; 31 | oceanBase = ((WaterBase)serObj.targetObject).gameObject; 32 | if(!oceanBase) 33 | return; 34 | 35 | GUILayout.Label ("This script helps adjusting water material properties", EditorStyles.miniBoldLabel); 36 | 37 | EditorGUILayout.PropertyField(sharedMaterial, new GUIContent("Material")); 38 | oceanMaterial = (Material)sharedMaterial.objectReferenceValue; 39 | 40 | if (!oceanMaterial) { 41 | sharedMaterial.objectReferenceValue = (Object)WaterEditorUtility.LocateValidWaterMaterial(oceanBase.transform); 42 | serObj.ApplyModifiedProperties(); 43 | oceanMaterial = (Material)sharedMaterial.objectReferenceValue; 44 | if (!oceanMaterial) 45 | return; 46 | } 47 | 48 | EditorGUILayout.Separator (); 49 | 50 | GUILayout.Label ("Overall Quality", EditorStyles.boldLabel); 51 | EditorGUILayout.PropertyField(waterQuality, new GUIContent("Quality")); 52 | EditorGUILayout.PropertyField(edgeBlend, new GUIContent("Edge blend?")); 53 | 54 | if(waterQuality.intValue > (int)WaterQuality.Low && !SystemInfo.supportsRenderTextures) 55 | EditorGUILayout.HelpBox("Water features not supported", MessageType.Warning); 56 | if(edgeBlend.boolValue && !SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) 57 | EditorGUILayout.HelpBox("Edge blend not supported", MessageType.Warning); 58 | 59 | EditorGUILayout.Separator (); 60 | 61 | bool hasShore = oceanMaterial.HasProperty("_ShoreTex"); 62 | 63 | GUILayout.Label ("Main Colors", EditorStyles.boldLabel); 64 | GUILayout.Label ("Alpha values define blending with realtime textures", EditorStyles.miniBoldLabel); 65 | 66 | WaterEditorUtility.SetMaterialColor("_BaseColor", EditorGUILayout.ColorField("Refraction", WaterEditorUtility.GetMaterialColor("_BaseColor", oceanMaterial)), oceanMaterial); 67 | WaterEditorUtility.SetMaterialColor("_ReflectionColor", EditorGUILayout.ColorField("Reflection", WaterEditorUtility.GetMaterialColor("_ReflectionColor", oceanMaterial)), oceanMaterial); 68 | 69 | EditorGUILayout.Separator (); 70 | 71 | GUILayout.Label ("Main Textures", EditorStyles.boldLabel); 72 | GUILayout.Label ("Used for small waves (bumps), foam and white caps", EditorStyles.miniBoldLabel); 73 | 74 | WaterEditorUtility.SetMaterialTexture("_BumpMap",(Texture)EditorGUILayout.ObjectField("Normals", WaterEditorUtility.GetMaterialTexture("_BumpMap", waterBase.sharedMaterial), typeof(Texture), false), waterBase.sharedMaterial); 75 | if (hasShore) 76 | WaterEditorUtility.SetMaterialTexture("_ShoreTex", (Texture)EditorGUILayout.ObjectField("Shore & Foam", WaterEditorUtility.GetMaterialTexture("_ShoreTex", waterBase.sharedMaterial), typeof(Texture), false), waterBase.sharedMaterial); 77 | 78 | Vector4 animationTiling; 79 | Vector4 animationDirection; 80 | 81 | Vector2 firstTiling; 82 | Vector2 secondTiling; 83 | Vector2 firstDirection; 84 | Vector2 secondDirection; 85 | 86 | animationTiling = WaterEditorUtility.GetMaterialVector("_BumpTiling", oceanMaterial); 87 | animationDirection = WaterEditorUtility.GetMaterialVector("_BumpDirection", oceanMaterial); 88 | 89 | firstTiling = new Vector2(animationTiling.x*100.0F,animationTiling.y*100.0F); 90 | secondTiling = new Vector2(animationTiling.z*100.0F,animationTiling.w*100.0F); 91 | 92 | firstTiling = EditorGUILayout.Vector2Field("Tiling 1", firstTiling); 93 | secondTiling = EditorGUILayout.Vector2Field("Tiling 2", secondTiling); 94 | 95 | //firstTiling.x = EditorGUILayout.FloatField("1st Tiling U", firstTiling.x); 96 | //firstTiling.y = EditorGUILayout.FloatField("1st Tiling V", firstTiling.y); 97 | //secondTiling.x = EditorGUILayout.FloatField("2nd Tiling U", secondTiling.x); 98 | //secondTiling.y = EditorGUILayout.FloatField("2nd Tiling V", secondTiling.y); 99 | 100 | firstDirection = new Vector2(animationDirection.x,animationDirection.y); 101 | secondDirection = new Vector2(animationDirection.z,animationDirection.w); 102 | 103 | //firstDirection.x = EditorGUILayout.FloatField("1st Animation U", firstDirection.x); 104 | //firstDirection.y = EditorGUILayout.FloatField("1st Animation V", firstDirection.y); 105 | //secondDirection.x = EditorGUILayout.FloatField("2nd Animation U", secondDirection.x); 106 | //secondDirection.y = EditorGUILayout.FloatField("2nd Animation V", secondDirection.y); 107 | 108 | firstDirection = EditorGUILayout.Vector2Field("Direction 1", firstDirection); 109 | secondDirection = EditorGUILayout.Vector2Field("Direction 2", secondDirection); 110 | 111 | animationTiling = new Vector4(firstTiling.x/100.0F,firstTiling.y/100.0F, secondTiling.x/100.0F,secondTiling.y/100.0F); 112 | animationDirection = new Vector4(firstDirection.x,firstDirection.y, secondDirection.x,secondDirection.y); 113 | 114 | WaterEditorUtility.SetMaterialVector("_BumpTiling", animationTiling, oceanMaterial); 115 | WaterEditorUtility.SetMaterialVector("_BumpDirection", animationDirection, oceanMaterial); 116 | 117 | Vector4 displacementParameter = WaterEditorUtility.GetMaterialVector("_DistortParams", oceanMaterial); 118 | Vector4 fade = WaterEditorUtility.GetMaterialVector("_InvFadeParemeter", oceanMaterial); 119 | 120 | EditorGUILayout.Separator (); 121 | 122 | GUILayout.Label ("Normals", EditorStyles.boldLabel); 123 | GUILayout.Label ("Displacement for fresnel, specular and reflection/refraction", EditorStyles.miniBoldLabel); 124 | 125 | float gerstnerNormalIntensity = WaterEditorUtility.GetMaterialFloat("_GerstnerIntensity", oceanMaterial); 126 | gerstnerNormalIntensity = EditorGUILayout.Slider("Per Vertex", gerstnerNormalIntensity, -2.5F, 2.5F); 127 | WaterEditorUtility.SetMaterialFloat("_GerstnerIntensity", gerstnerNormalIntensity, oceanMaterial); 128 | 129 | displacementParameter.x = EditorGUILayout.Slider("Per Pixel", displacementParameter.x, -4.0F, 4.0F); 130 | displacementParameter.y = EditorGUILayout.Slider("Distortion", displacementParameter.y, -0.5F, 0.5F); 131 | // fade.z = EditorGUILayout.Slider("Distance fade", fade.z, 0.0f, 0.5f); 132 | 133 | EditorGUILayout.Separator (); 134 | 135 | GUILayout.Label ("Fresnel", EditorStyles.boldLabel); 136 | GUILayout.Label ("Defines reflection to refraction relation", EditorStyles.miniBoldLabel); 137 | 138 | if(!oceanMaterial.HasProperty("_Fresnel")) { 139 | if(oceanMaterial.HasProperty("_FresnelScale")) { 140 | float fresnelScale = EditorGUILayout.Slider("Intensity", WaterEditorUtility.GetMaterialFloat("_FresnelScale", oceanMaterial), 0.1F, 4.0F); 141 | WaterEditorUtility.SetMaterialFloat("_FresnelScale", fresnelScale, oceanMaterial); 142 | } 143 | displacementParameter.z = EditorGUILayout.Slider("Power", displacementParameter.z, 0.1F, 10.0F); 144 | displacementParameter.w = EditorGUILayout.Slider("Bias", displacementParameter.w, -3.0F, 3.0F); 145 | } 146 | else 147 | { 148 | Texture fresnelTex = (Texture)EditorGUILayout.ObjectField( 149 | "Ramp", 150 | (Texture)WaterEditorUtility.GetMaterialTexture("_Fresnel", 151 | oceanMaterial), 152 | typeof(Texture), 153 | false); 154 | WaterEditorUtility.SetMaterialTexture("_Fresnel", fresnelTex, oceanMaterial); 155 | } 156 | 157 | EditorGUILayout.Separator (); 158 | 159 | WaterEditorUtility.SetMaterialVector("_DistortParams", displacementParameter, oceanMaterial); 160 | 161 | if (edgeBlend.boolValue) 162 | { 163 | GUILayout.Label ("Fading", EditorStyles.boldLabel); 164 | 165 | fade.x = EditorGUILayout.Slider("Edge fade", fade.x, 0.001f, 3.0f); 166 | if(hasShore) 167 | fade.y = EditorGUILayout.Slider("Shore fade", fade.y, 0.001f, 3.0f); 168 | fade.w = EditorGUILayout.Slider("Extinction fade", fade.w, 0.0f, 2.5f); 169 | 170 | WaterEditorUtility.SetMaterialVector("_InvFadeParemeter", fade, oceanMaterial); 171 | } 172 | EditorGUILayout.Separator (); 173 | 174 | if(oceanMaterial.HasProperty("_Foam")) { 175 | GUILayout.Label ("Foam", EditorStyles.boldLabel); 176 | 177 | Vector4 foam = WaterEditorUtility.GetMaterialVector("_Foam", oceanMaterial); 178 | 179 | foam.x = EditorGUILayout.Slider("Intensity", foam.x, 0.0F, 1.0F); 180 | foam.y = EditorGUILayout.Slider("Cutoff", foam.y, 0.0F, 1.0F); 181 | 182 | WaterEditorUtility.SetMaterialVector("_Foam", foam, oceanMaterial); 183 | } 184 | 185 | serObj.ApplyModifiedProperties(); 186 | } 187 | 188 | } -------------------------------------------------------------------------------- /Assets/Scripts/CameraController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.IO; 4 | 5 | public class CameraController : MonoBehaviour { 6 | 7 | private Vector3 mousePosition; 8 | private TerrainGenerator world; 9 | 10 | private bool autopilot; 11 | private Vector3 destination; 12 | private Vector3 velocity; 13 | 14 | private GameObject target; 15 | private bool wireframe; 16 | private bool showGui; 17 | 18 | // Use this for initialization 19 | void Start () { 20 | Screen.lockCursor = true; 21 | world = GameObject.Find("World").GetComponent(); 22 | 23 | //this.transform.position = new Vector3(Random.value - 0.5f, 0.1f, Random.value - 0.5f) * world.Width / 2; 24 | //this.transform.LookAt(Vector3.up * 50f); 25 | 26 | target = GameObject.CreatePrimitive(PrimitiveType.Sphere); 27 | target.renderer.enabled = false; 28 | } 29 | 30 | // Update is called once per frame 31 | void Update () { 32 | var pos = this.transform.position; 33 | var terrainPos = world != null ? world.transform.InverseTransformPoint(pos) : pos; 34 | float terrainHeight = world != null ? Mathf.Max(world.SampleHeight(terrainPos.x, terrainPos.z), 0) : 0; 35 | 36 | float cameraHeight = this.transform.position.y; 37 | float height = cameraHeight - terrainHeight; 38 | float speed = Time.deltaTime * (height + 1); 39 | 40 | Vector3 direction = Vector3.zero; 41 | 42 | if (Input.GetKey(KeyCode.W)) { 43 | direction += this.transform.TransformDirection(Vector3.forward); 44 | autopilot = false; 45 | } 46 | else if (Input.GetKey(KeyCode.S)) { 47 | direction += this.transform.TransformDirection(Vector3.back); 48 | autopilot = false; 49 | } 50 | 51 | if (Input.GetKey(KeyCode.A)) { 52 | direction += this.transform.TransformDirection(Vector3.left); 53 | autopilot = false; 54 | } 55 | else if (Input.GetKey(KeyCode.D)) { 56 | direction += this.transform.TransformDirection(Vector3.right); 57 | autopilot = false; 58 | } 59 | 60 | if (Input.GetKey(KeyCode.Space)) { 61 | direction += Vector3.up; 62 | autopilot = false; 63 | 64 | //this.rigidbody.useGravity = false; 65 | } 66 | else if (Input.GetKey(KeyCode.LeftControl)) { 67 | direction += Vector3.down; 68 | autopilot = false; 69 | 70 | //this.rigidbody.useGravity = false; 71 | } 72 | else { 73 | //this.rigidbody.useGravity = true; 74 | } 75 | 76 | if (autopilot) { 77 | if (Vector3.Distance(target.transform.position, destination) < speed) { 78 | //destination = Random.insideUnitSphere * 100f + velocity.normalized * 100f + target.transform.position; 79 | 80 | //if (destination.magnitude > world.Width / 2f) { 81 | destination = Random.insideUnitSphere * world.Width / 2f; 82 | //} 83 | 84 | var terrainDestination = world.transform.InverseTransformPoint(destination); 85 | float destinationHeight = Mathf.Max(0f, world.SampleHeight(terrainDestination.x, terrainDestination.z)); 86 | 87 | if (destination.y > 100f) { 88 | destination.y = 100f; 89 | } 90 | 91 | if (destination.y < destinationHeight + 0f) { 92 | destination.y = destinationHeight + 0f; 93 | } 94 | } 95 | 96 | Vector3 start = target.transform.position; 97 | target.transform.Translate((destination - target.transform.position).normalized * speed, Space.World); 98 | SnapToTerrain(target, 0f); 99 | Vector3 end = target.transform.position; 100 | Vector3 displ = (end - start).normalized; 101 | 102 | this.transform.position = Vector3.SmoothDamp(pos, target.transform.TransformPoint(-displ * 10), ref velocity, 2f); 103 | SnapToTerrain(this.gameObject, 20f); 104 | this.transform.rotation = Quaternion.LookRotation(velocity); 105 | } 106 | else { 107 | velocity = Vector3.Lerp(velocity, direction * speed, 0.1f); 108 | this.transform.Translate(velocity, Space.World); 109 | 110 | float dx = Input.GetAxis("Mouse X"); 111 | float dy = Input.GetAxis("Mouse Y"); 112 | 113 | float rx = 1f; 114 | float ry = 1f; 115 | 116 | this.transform.Rotate(-dy * ry, dx * rx, 0); 117 | this.transform.LookAt(this.transform.TransformPoint(Vector3.forward)); 118 | 119 | SnapToTerrain(this.gameObject, 1f); 120 | } 121 | 122 | //if (Input.GetMouseButtonDown(0)) { 123 | // var sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); 124 | // sphere.transform.localScale *= 0.1f; 125 | //} 126 | 127 | if (Input.GetKeyUp(KeyCode.P)) { 128 | TurnAutoPilot(); 129 | } 130 | 131 | //if (this.transform.position.y < 0) { 132 | // RenderSettings.fog = true; 133 | //} 134 | //else { 135 | // RenderSettings.fog = false; 136 | //} 137 | 138 | if (Input.GetKeyUp(KeyCode.G)) { 139 | showGui = !showGui; 140 | Screen.lockCursor = !showGui; 141 | } 142 | 143 | if (Input.GetKeyUp(KeyCode.F)) { 144 | wireframe = !wireframe; 145 | } 146 | 147 | if (Input.GetKeyUp(KeyCode.C)) { 148 | if (!Directory.Exists("Screenshots")) { 149 | Directory.CreateDirectory("Screenshots"); 150 | } 151 | 152 | string path = string.Format("Screenshots/Screenshot-{0}.png", System.DateTime.Now.ToFileTimeUtc()); 153 | Application.CaptureScreenshot(path); 154 | Debug.Log("Saving screenshot: " + path); 155 | } 156 | 157 | if (Input.GetKeyUp(KeyCode.R)) { 158 | recording = !recording; 159 | 160 | if (recording) { 161 | Time.captureFramerate = 25; 162 | recordingFolder = string.Format("Recording-{0}", System.DateTime.Now.ToFileTimeUtc()); 163 | Directory.CreateDirectory(recordingFolder); 164 | Debug.Log("Recording started at: " + recordingFolder); 165 | } 166 | else { 167 | Debug.Log("Recording stopped"); 168 | Time.captureFramerate = 0; 169 | } 170 | } 171 | 172 | if (Input.GetKeyUp(KeyCode.B)) { 173 | Vector3 position = this.transform.position; 174 | Vector3 rotation = this.transform.rotation.eulerAngles; 175 | 176 | PlayerPrefs.SetFloat("PosX", position.x); 177 | PlayerPrefs.SetFloat("PosY", position.y); 178 | PlayerPrefs.SetFloat("PosZ", position.z); 179 | 180 | PlayerPrefs.SetFloat("RotX", rotation.x); 181 | PlayerPrefs.SetFloat("RotY", rotation.y); 182 | PlayerPrefs.SetFloat("RotZ", rotation.z); 183 | 184 | PlayerPrefs.Save(); 185 | } 186 | else if (Input.GetKey(KeyCode.N)) { 187 | float px = PlayerPrefs.GetFloat("PosX", transform.position.x); 188 | float py = PlayerPrefs.GetFloat("PosY", transform.position.y); 189 | float pz = PlayerPrefs.GetFloat("PosZ", transform.position.z); 190 | 191 | float rx = PlayerPrefs.GetFloat("RotX", transform.rotation.eulerAngles.x); 192 | float ry = PlayerPrefs.GetFloat("RotY", transform.rotation.eulerAngles.y); 193 | float rz = PlayerPrefs.GetFloat("RotZ", transform.rotation.eulerAngles.z); 194 | 195 | this.transform.position = Vector3.MoveTowards(this.transform.position, new Vector3(px, py, pz), speed); 196 | this.transform.rotation = Quaternion.RotateTowards(this.transform.rotation, Quaternion.Euler(rx, ry, rz), Time.deltaTime * 45); 197 | } 198 | 199 | if (recording) { 200 | Application.CaptureScreenshot(string.Format("{0}/{1:D04}.png", recordingFolder, Time.frameCount)); 201 | } 202 | 203 | Debug.DrawRay(this.transform.position, this.transform.TransformDirection(Vector3.forward * 100f)); 204 | } 205 | 206 | void OnPreRender() { 207 | GL.wireframe = wireframe; 208 | } 209 | 210 | private void TurnAutoPilot() { 211 | autopilot = !autopilot; 212 | destination = this.transform.position + this.transform.TransformDirection(Vector3.forward * 10f); 213 | target.transform.position = destination; 214 | } 215 | 216 | private void SnapToTerrain(GameObject obj, float height) { 217 | var pos = obj.transform.position; 218 | var terrainPos = world != null ? world.transform.InverseTransformPoint(pos) : pos; 219 | //float terrainHeight = world.SampleHeight(terrainPos.x, terrainPos.z); 220 | float terrainHeight = world != null ? Mathf.Max(world.SampleHeight(terrainPos.x, terrainPos.z), 0f) : 0; 221 | 222 | if (pos.y < terrainHeight + height) { 223 | obj.transform.position = new Vector3(pos.x, terrainHeight + height, pos.z); 224 | } 225 | else if (pos.y > 10000) { 226 | obj.transform.position = new Vector3(pos.x, 10000, pos.z); 227 | } 228 | } 229 | 230 | void OnGUI() { 231 | if (!showGui) 232 | return; 233 | 234 | GL.wireframe = false; 235 | 236 | GUI.Box(new Rect(20, 20, 200, 25), string.Format("Open Nodes: {0}", Generator.OpenNodes)); 237 | GUI.Box(new Rect(20, 50, 200, 25), string.Format("Steps per Second: {0:0.0}", Generator.StepsPerSecond)); 238 | GUI.Box(new Rect(20, 80, 200, 25), string.Format("Wireframe: {0}", GL.wireframe)); 239 | 240 | if (GUI.Button(new Rect(Screen.width - 120, 20, 100, 30), "Restart")) { 241 | world.Restart(); 242 | } 243 | if (GUI.Button(new Rect(Screen.width - 120, 55, 100, 30), "Quit")) { 244 | Application.Quit(); 245 | } 246 | } 247 | 248 | private string recordingFolder; 249 | private bool recording; 250 | } 251 | --------------------------------------------------------------------------------