Work on architecture. A lot of refractoring. Updated to unity 5.

This commit is contained in:
Tiberiu Chibici 2015-03-12 10:44:44 +02:00
parent c51c5abbb1
commit c71b8ddd3e
436 changed files with 2144 additions and 17293 deletions

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -47,12 +47,13 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\MouseLook.cs" />
<Compile Include="Assets\Standard Assets\Water (Basic)\Sources\Scripts\WaterSimple.cs" />
<Compile Include="Assets\Standard Assets\Environment\Water (Basic)\Scripts\WaterBasic.cs" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -47,12 +47,13 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\MouseLook.cs" />
<Compile Include="Assets\Standard Assets\Water (Basic)\Sources\Scripts\WaterSimple.cs" />
<Compile Include="Assets\Standard Assets\Environment\Water (Basic)\Scripts\WaterBasic.cs" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -48,7 +48,6 @@
<ItemGroup>
<Compile Include="Assets\Scripts\Business\BiomeManager.cs" />
<Compile Include="Assets\Scripts\Business\ConfigurationManager.cs" />
<Compile Include="Assets\Scripts\Generator\MapImageRenderer.cs" />
<Compile Include="Assets\Scripts\Generator\TerrainGenerator.cs" />
<Compile Include="Assets\Scripts\InitializeScript.cs" />
<Compile Include="Assets\Scripts\Model\Biome.cs" />
@ -63,15 +62,18 @@
<Compile Include="Assets\Scripts\Utils\Logger.cs" />
<Compile Include="Assets\Scripts\Utils\RandomExtensions.cs" />
<Compile Include="Assets\Scripts\Utils\Range.cs" />
<Compile Include="Assets\Scripts\Utils\Task.cs" />
<Compile Include="Assets\Scripts\Utils\Texture2DExtensions.cs" />
<Compile Include="Assets\Scripts\Utils\XmlHelper.cs" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="Assembly-UnityScript-firstpass">
<HintPath>E:/Facultate/$ Licenta/Game/Library/ScriptAssemblies/Assembly-UnityScript-firstpass.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -48,7 +48,6 @@
<ItemGroup>
<Compile Include="Assets\Scripts\Business\BiomeManager.cs" />
<Compile Include="Assets\Scripts\Business\ConfigurationManager.cs" />
<Compile Include="Assets\Scripts\Generator\MapImageRenderer.cs" />
<Compile Include="Assets\Scripts\Generator\TerrainGenerator.cs" />
<Compile Include="Assets\Scripts\InitializeScript.cs" />
<Compile Include="Assets\Scripts\Model\Biome.cs" />
@ -63,12 +62,15 @@
<Compile Include="Assets\Scripts\Utils\Logger.cs" />
<Compile Include="Assets\Scripts\Utils\RandomExtensions.cs" />
<Compile Include="Assets\Scripts\Utils\Range.cs" />
<Compile Include="Assets\Scripts\Utils\Task.cs" />
<Compile Include="Assets\Scripts\Utils\Texture2DExtensions.cs" />
<Compile Include="Assets\Scripts\Utils\XmlHelper.cs" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -49,11 +49,12 @@
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\CharacterMotor.js" />
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\FPSInputController.js" />
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\PlatformInputController.js" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_4_6_1;UNITY_4_6;UNITY_STANDALONE_WIN;ENABLE_MICROPHONE;ENABLE_TEXTUREID_MAP;ENABLE_UNITYEVENTS;ENABLE_NEW_HIERARCHY ;ENABLE_AUDIO_FMOD;UNITY_STANDALONE;ENABLE_MONO;ENABLE_TERRAIN;ENABLE_SUBSTANCE;ENABLE_GENERICS;INCLUDE_WP8SUPPORT;ENABLE_MOVIES;ENABLE_WWW;ENABLE_IMAGEEFFECTS;ENABLE_4_6_FEATURES;INCLUDE_WP_BLUE_SUPPORT;ENABLE_WEBCAM;INCLUDE_METROSUPPORT;RENDER_SOFTWARE_CURSOR;ENABLE_NETWORK;ENABLE_PHYSICS;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_2D_PHYSICS;ENABLE_SHADOWS;ENABLE_AUDIO;ENABLE_NAVMESH_CARVING;ENABLE_DUCK_TYPING;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_WIN</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_0_0;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
@ -49,11 +49,12 @@
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\CharacterMotor.js" />
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\FPSInputController.js" />
<Compile Include="Assets\Standard Assets\Character Controllers\Sources\Scripts\PlatformInputController.js" />
<None Include="Assets\Data\Config\tergen.xml" />
<None Include="Assets\Data\Biomes\Mountain\Mountain.xml" />
<None Include="Assets\Standard Assets\Water (Basic)\Sources\Shaders\FX-Water Simple.shader" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Data\Biomes\Grassland\Grassland.xml" />
<Reference Include="UnityEngine.UI">
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/4.6.1/UnityEngine.UI.dll</HintPath>
<HintPath>E:/SDKs/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<biome>
<name>Grassland</name>
<heightRange min="0" max="1" />
<heightRange min="0" max="10" />
<moisture min=".1" max=".5"/>
<vegetationDensity min=".2" max=".5" />
</biome>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<biome>
<name>Mountain</name>
<heightRange min="0" max="10" />
<heightRange min="0" max="500" />
<moisture min=".1" max=".3"/>
<vegetationDensity min=".5" max=".9" />
</biome>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<terrgenConfig>
<noiseOctaves>8</noiseOctaves>
<noiseNonLinearPower>2</noiseNonLinearPower>
<elevationScale>10</elevationScale>
</terrgenConfig>

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1eca86e155e8dfc48b71dded971f7d2c
timeCreated: 1425647036
licenseType: Free
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -11,7 +11,7 @@ namespace TransportGame.Business
{
public static class BiomeManager
{
private static Dictionary<string, Biome> biomes = new Dictionary<string, Biome>();
private static List<Biome> biomes = new List<Biome>();
/// <summary>
/// Gets all the loaded biomes
@ -20,7 +20,7 @@ namespace TransportGame.Business
{
get
{
return biomes.Values;
return biomes;
}
}
@ -41,7 +41,7 @@ namespace TransportGame.Business
var biome = (Biome)serializer.Deserialize(stream);
// Add it to biome list
biomes.Add(file, biome);
biomes.Add(biome);
Logger.Info("Loaded biome '{0}' from file '{1}'.", biome.Name, file);
}
catch (Exception ex)

View File

@ -1,8 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using Assets.Scripts.Model.Config;
using TransportGame.Utils;
namespace TransportGame.Business
{
@ -11,10 +14,14 @@ namespace TransportGame.Business
public static readonly string BiomeDirectory = "Assets\\Data\\Biomes";
public static readonly string ConfigurationDirectory = "Assets\\Data\\Config";
public static readonly string TerrGenConfigFile = "tergen.xml";
public static TerrainGeneratorConfig TerrGenConfig { get; private set; }
public static void LoadConfiguration()
{
// Load terrgen config
TerrGenConfig = XmlHelper.Deserialize<TerrainGeneratorConfig>(Path.Combine(ConfigurationDirectory, TerrGenConfigFile));
}
}
}

View File

@ -1,155 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using TransportGame.Model;
using TransportGame.Utils;
using UnityEngine;
namespace TransportGame.Generators
{
public static class MapImageRenderer
{
[Flags]
public enum Layers
{
None = 0,
Elevation = 1,
Grid = 2,
Centers = 4,
All = Elevation | Grid | Centers
};
private const int Scale = 20;
/// <summary>
/// Renders a map to a file
/// </summary>
/// <param name="file"></param>
/// <param name="map"></param>
/// <param name="layers"></param>
//public static void Render(this Map map, string file, Layers layers = Layers.All)
//{
// // Create texture on which to draw
// Texture2D texture = new Texture2D(
// map.Width * Scale,
// map.Height * Scale,
// TextureFormat.RGB24,
// false);
// // First layer - cells
// DrawCells(texture, map, (layers & Layers.Elevation) > 0, (layers & Layers.Centers) > 0);
// // Second layer - grid
// if ((layers & Layers.Grid) > 0)
// DrawGrid(texture, map);
// // Write to file
// File.WriteAllBytes(file + ".png", texture.EncodeToPNG());
//}
//private static void DrawCells(Texture2D texture, Map map, bool elevation, bool centers)
//{
// for (int x = 0; x < map.Width; x++)
// for (int y = 0; y < map.Height; y++)
// {
// // Calculate scaled corners
// Vector2 c00 = new Vector2(
// map[x, y].Corner00.Pos.x * Scale,
// map[x, y].Corner00.Pos.y * Scale);
// Vector2 c01 = new Vector2(
// map[x, y].Corner01.Pos.x * Scale,
// map[x, y].Corner01.Pos.y * Scale);
// Vector2 c10 = new Vector2(
// map[x, y].Corner10.Pos.x * Scale,
// map[x, y].Corner10.Pos.y * Scale);
// Vector2 c11 = new Vector2(
// map[x, y].Corner11.Pos.x * Scale,
// map[x, y].Corner11.Pos.y * Scale);
// // Calculate color
// Color c = ColorHelper.FromArgb(0x555500);
// // Water - always blue
// if (map.IsWater(x, y))
// c = Color.blue;
// // Map type is elevation map - get elevation color
// else if (elevation)
// c = GetCollorOfTerrain(map[x, y].Elevation);
// // Draw polygon
// texture.FillPolygon(c, c00, c01, c11, c10);
// // Draw center
// if (centers)
// texture.DrawPoint(Color.red,
// Convert.ToInt32(map[x, y].Center.x * Scale),
// Convert.ToInt32(map[x, y].Center.y * Scale),
// 2);
// }
//}
//private static void DrawGrid(Texture2D texture, Map map)
//{
// for (int x = 0; x < map.Width + 1; x++)
// for (int y = 0; y < map.Height + 1; y++)
// {
// Corner c0 = map.Corner(x, y);
// Vector2 c0pos = new Vector2(c0.Pos.x * Scale, c0.Pos.y * Scale);
// // Draw edges
// if (x > 0)
// {
// Corner c1 = map.Corner(x - 1, y);
// Vector2 c1pos = new Vector2(c1.Pos.x * Scale, c1.Pos.y * Scale);
// texture.DrawLine(Color.white, c0pos, c1pos);
// }
// if (y > 0)
// {
// Corner c1 = map.Corner(x, y - 1);
// Vector2 c1pos = new Vector2(c1.Pos.x * Scale, c1.Pos.y * Scale);
// texture.DrawLine(Color.white, c0pos, c1pos);
// }
// // Draw corner
// texture.DrawPoint(Color.white, c0pos, 2);
// }
//}
private static Color GetCollorOfTerrain(float height)
{
Color color1, color2;
float alpha;
if (height < 10f)
{
color1 = ColorHelper.FromArgb(0x00ffa2);
color2 = ColorHelper.FromArgb(0xFCD628);
alpha = height / 10f;
}
else if (height < 25f)
{
color1 = ColorHelper.FromArgb(0xFCD628);
color2 = ColorHelper.FromArgb(0x9C6713);
alpha = (height - 10f) / 15f;
}
else if (height < 50f)
{
color1 = ColorHelper.FromArgb(0xaaaaaa);
color2 = ColorHelper.FromArgb(0xffffff);
alpha = (height - 25f) / 25f;
}
else
{
color1 = color2 = Color.white;
alpha = 1;
}
return Color.Lerp(color1, color2, alpha);
}
}
}

View File

@ -20,6 +20,10 @@ namespace TransportGame.Generator
public TerrainGenerator()
{
Noise = new PerlinNoiseGenerator();
if (ConfigurationManager.TerrGenConfig == null)
throw new Exception("WTF?");
Noise.Octaves = ConfigurationManager.TerrGenConfig.NoiseOctaves;
Noise.NonLinearPower = ConfigurationManager.TerrGenConfig.NoiseNonLinearPower;
Noise.Scale = ConfigurationManager.TerrGenConfig.ElevationScale;
@ -32,6 +36,7 @@ namespace TransportGame.Generator
// Pick a random biome
map.Biome = PickBiome();
Logger.Info("Picked biome: {0}", map.Biome.Name);
// Generate elevation
GenerateElevation(map);
@ -40,6 +45,7 @@ namespace TransportGame.Generator
float waterAmount = random.NextSingle(map.Biome.Moisture.Minimum, map.Biome.Moisture.Maximum);
map.WaterLevel = Mathf.Pow(waterAmount, 3) * (map.Biome.HeightRange.Maximum - map.Biome.HeightRange.Minimum) + map.Biome.HeightRange.Minimum;
DumpData(map);
return map;
}
@ -57,5 +63,22 @@ namespace TransportGame.Generator
for (int y = 0; y < map.Height; ++y)
map[x, y] = Noise.Generate(x, y, map.Biome.HeightRange.Minimum, map.Biome.HeightRange.Maximum);
}
private void DumpData(Map map)
{
StringBuilder builder = new StringBuilder();
for (int x = 0; x < map.Width; ++x)
{
for (int y = 0; y < map.Height; ++y)
{
builder.Append(map[x, y]);
builder.Append(';');
}
builder.AppendLine();
}
Logger.Info("Generated map: \n{0}", builder.ToString());
}
}
}

View File

@ -1,109 +1,28 @@
using UnityEngine;
using System.Collections;
using TransportGame.Utils;
using TransportGame.Model;
using TransportGame.Generators;
using System.Collections.Generic;
using System.Collections;
using System.Threading;
using TransportGame.Business;
using TransportGame.Model;
using TransportGame.Utils;
using UnityEngine;
public class InitializeScript : MonoBehaviour
{
public Material TerrainMaterial;
public int TerrainWidth = 256, TerrainHeight = 256;
private Map map;
// Use this for initialization
public void Start()
{
StartCoroutine(GenerateMap());
}
// Load configuration
Logger.Info("Loading configuration...");
ConfigurationManager.LoadConfiguration();
Logger.Info("Finished loading configuration.");
private IEnumerator GenerateMap()
{
// Load biomes
Logger.Info("Loading biomes...");
BiomeManager.LoadBiomes();
Logger.Info("Finished loading biomes.");
// Generate map in the other thread
Thread thread = new Thread(GenerateMapThread);
thread.Start();
while (thread.ThreadState == ThreadState.Running)
{
yield return null;
}
thread.Join();
// map.Render(@"C:\Users\Tiberiu\Desktop\img");
// Log - Generate mesh
yield return null;
Debug.Log("Generating mesh...");
var heights = new float[map.Width, map.Height];
for (int x = 0; x < map.Width; x++)
for (int y = 0; y < map.Height; y++)
heights[x, y] = map[y, x] / 50f;
// Generate mesh using terraindata
TerrainData terrainData = new TerrainData();
terrainData.heightmapResolution = map.Width;
terrainData.size = new Vector3(map.Width * MapMeshGenerator.Scale, 50.0f * MapMeshGenerator.Strength, map.Height * MapMeshGenerator.Scale);
//terrainData.baseMapResolution = 1024;
//terrainData.alphamapResolution = 512;
terrainData.SetDetailResolution(1024, 8);
terrainData.SetHeights(0, 0, heights);
terrainData.name = "Le terrain data";
GameObject terrainObj = Terrain.CreateTerrainGameObject(terrainData);
terrainObj.name = "Le Terrain";
Terrain t1 = terrainObj.GetComponent<Terrain>();
t1.heightmapPixelError = 1;
MapMeshGenerator meshGen = new MapMeshGenerator(map);
//for (int x = 0; x < meshGen.ChunksWidth; x++)
// for (int y = 0; y < meshGen.ChunksHeight; y++)
// {
// CreateGameObjectFromMesh(string.Format("chunk_{0}_{1}", x, y), meshGen[x, y], TerrainMaterial);
// yield return null;
// }
// Generate water
GameObject water = GameObject.Find("Water");
MeshFilter waterFilter = water.GetComponent<MeshFilter>();
waterFilter.mesh = meshGen.Water;
yield return null;
Debug.Log("Finished generating map.");
yield return null;
}
private void CreateGameObjectFromMesh(string name, Mesh mesh, Material material)
{
GameObject gameObject = new GameObject(name);
// Add mesh filter component
MeshFilter meshFilter = gameObject.AddComponent<MeshFilter>();
meshFilter.mesh = mesh;
// Add mesh render component
MeshRenderer meshRenderer = gameObject.AddComponent<MeshRenderer>();
meshRenderer.material = material;
}
private void GenerateMapThread()
{
MapGenerator mapGen = new MapGenerator();
map = mapGen.Generate(TerrainWidth, TerrainHeight);
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -1,8 +1,12 @@
fileFormatVersion: 2
guid: c1e1bcc13284685449456c96db1d1754
timeCreated: 1425647800
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -100
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -9,11 +9,13 @@ namespace Assets.Scripts.Model.Config
[XmlRoot("terrgenConfig")]
public class TerrainGeneratorConfig
{
[XmlElement("noiseOctaves")]
public int NoiseOctaves { get; set; }
[XmlElement("noiseNonLinearPower")]
public float NoiseNonLinearPower { get; set; }
[XmlElement("elevationScale")]
public float ElevationScale { get; set; }
}
}

View File

@ -20,6 +20,17 @@ namespace TransportGame.Model
/// </summary>
public Biome Biome { get; set; }
/// <summary>
/// Gets the heights array
/// </summary>
public float[,] Heights
{
get
{
return grid;
}
}
/// <summary>
/// Initializes the map
/// </summary>

View File

@ -1,15 +1,87 @@
using UnityEngine;
using System.Collections;
using TransportGame.Utils;
using System.Threading;
using TransportGame.Generator;
using TransportGame.Model;
using TransportGame.Business;
public class TerrainGeneratorScript : MonoBehaviour {
public class TerrainGeneratorScript : MonoBehaviour
{
private Map map = null;
public int TerrainWidth = 256;
public int TerrainHeight = 256;
public GameObject WaterObject;
// Use this for initialization
void Start () {
void Start()
{
StartCoroutine(GenerateMap());
}
private void GenerateMapThread()
{
TerrainGenerator generator = new TerrainGenerator();
map = generator.Generate(TerrainWidth, TerrainHeight);
}
private Mesh GenerateWater()
{
Mesh water = new Mesh();
water.name = "water";
water.vertices = new[] {
new Vector3(0, map.WaterLevel, 0),
new Vector3(0, map.WaterLevel, map.Height),
new Vector3(map.Width, map.WaterLevel, 0),
new Vector3(map.Width, map.WaterLevel, map.Height)
};
water.triangles = new[] { 0, 1, 2, 2, 1, 3 };
water.uv = new[] {
new Vector2(0, 0),
new Vector2(0, 1),
new Vector2(1, 0),
new Vector2(1, 1)
};
water.RecalculateNormals();
return water;
}
private IEnumerator GenerateMap()
{
// Wait for the map generation thread
foreach (var i in Task.RunAsync(GenerateMapThread))
yield return i;
// Generate terrain data
TerrainData terrainData = new TerrainData();
terrainData.heightmapResolution = Mathf.Max(map.Height, map.Width);
terrainData.size = new Vector3(map.Width, map.Biome.HeightRange.Maximum, map.Height);
terrainData.SetDetailResolution(1024, 8);
terrainData.SetHeights(0, 0, map.Heights);
terrainData.name = "Generated Terrain Data";
yield return null;
// Create terrain object
GameObject terrain = Terrain.CreateTerrainGameObject(terrainData);
terrain.name = "Generated Terrain";
yield return null;
Terrain terrainComp = terrain.GetComponent<Terrain>();
terrainComp.heightmapPixelError = 1;
yield return null;
// Set water
if (WaterObject != null)
{
MeshFilter waterMesh = WaterObject.GetComponent<MeshFilter>();
waterMesh.mesh = GenerateWater();
}
}
// Update is called once per frame
void Update () {
void Update()
{
}
}

View File

@ -8,7 +8,7 @@ namespace TransportGame.Utils
{
public static class Logger
{
private static StreamWriter logFile;
private static string logFile = null;
public enum Level
{
@ -23,13 +23,24 @@ namespace TransportGame.Utils
// Open log file if not opened
if (logFile == null)
{
logFile = new StreamWriter(String.Format("Logs\\{0}.log", DateTime.Now.Ticks));
// Create logs folder
if (!Directory.Exists("Logs"))
Directory.CreateDirectory("Logs");
// Create log file
logFile = String.Format("Logs\\{0}.log", DateTime.Now.Ticks);
}
lock (logFile)
{
using (var writer = new StreamWriter(logFile, true))
{
// Log to file
logFile.Write("[{0}] ", Enum.GetName(typeof(Level), level));
logFile.Write(DateTime.Now.ToLongTimeString());
logFile.WriteLine(": " + format, args);
writer.Write("[{0}] ", Enum.GetName(typeof(Level), level));
writer.Write(DateTime.Now.ToString("%HH:%mm:%ss.%FFF"));
writer.WriteLine(": " + format, args);
writer.Close();
}
// Log to unity
switch (level)
@ -47,6 +58,7 @@ namespace TransportGame.Utils
break;
}
}
}
public static void Info(string format, params object[] args)
{

View File

@ -0,0 +1,56 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace TransportGame.Utils
{
public static class Task
{
private class TaskInfo
{
public Action Action { get; set; }
public bool? Success { get; set; }
public Exception ThrownException { get; set; }
}
private static void RunAsync_ActionThread(object info)
{
TaskInfo taskInfo = (TaskInfo)info;
try
{
taskInfo.Action();
taskInfo.Success = true;
}
catch (Exception ex)
{
taskInfo.ThrownException = ex;
taskInfo.Success = false;
}
}
public static IEnumerable RunAsync(Action action)
{
// Set up task info object
TaskInfo taskInfo = new TaskInfo();
taskInfo.Action = action;
// Start thread and wait
var thread = new Thread(RunAsync_ActionThread);
thread.Start(taskInfo);
// Wait for thread to finish
while (thread.ThreadState == ThreadState.Running)
yield return null;
thread.Join();
// Rethrow exception
if (taskInfo.Success.HasValue && !taskInfo.Success.Value)
throw new Exception("Task failed", taskInfo.ThrownException);
}
}
}

View File

@ -1,8 +1,12 @@
fileFormatVersion: 2
guid: d89d584776261fe4b81720b3615755bb
guid: e07530e47d7019b418499d12a7c29f35
timeCreated: 1425923206
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace TransportGame.Utils
{
public static class XmlHelper
{
/// <summary>
/// Deserializes a file
/// </summary>
/// <typeparam name="T">Type to deserialize</typeparam>
/// <param name="filename">File name</param>
/// <returns>Deserialized object</returns>
public static T Deserialize<T>(string filename)
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
var stream = new StreamReader(filename);
return (T)serializer.Deserialize(stream);
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a4d12846fa3e22f4fbd829e42582d6a9
timeCreated: 1425647029
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6ca8c4e270f964e0da9f731d7d34b123
folderAsset: yes
timeCreated: 1425647314
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 79fb6bd0250f9ff4981c5bb779ec9cbf
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 60e04b4d96370c54caa0ef878f17eb35
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,188 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WaterBasicDaytime
m_Shader: {fileID: 4800000, guid: 9dccc8e8f0da4494991c26ef59019551, type: 3}
m_ShaderKeywords: []
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c2ef94ff9d11915d1100a04b44295342, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: a53cf5449d11a15d1100a04b44295342, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ReflectionTex
second:
m_Texture: {fileID: 8400000, guid: 21bb33409d118354d000dcabe39e7c39, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorControlCube
second:
m_Texture: {fileID: 8900000, guid: 98c330f39d11745ad0004adb8d76c639, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorControl
second:
m_Texture: {fileID: 2800000, guid: 047330f39d11745ad0004adb8d76c639, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _WavesTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap2
second:
m_Texture: {fileID: 2800000, guid: 279fb0a19d11d4a6d00051fa8d76c639, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorGradient
second:
m_Texture: {fileID: 2800000, guid: 8403d3349d112ba4d000be1be39e7c39, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: 1
data:
first:
name: _WaveScale
second: .0702830181
data:
first:
name: _Highlight
second: 33.2075462
data:
first:
name: _bScale
second: .0700000003
data:
first:
name: _BumpPeturb
second: 82.07547
data:
first:
name: _BumpPeturb2
second: .745283008
data:
first:
name: _bTwirl
second: .0500000007
data:
first:
name: _distort
second: .100000001
m_Colors:
data:
first:
name: _Color
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _MainTex_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: _SpecColor
second: {r: 0, g: 0, b: 0, a: .400000006}
data:
first:
name: _BumpMap_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: WaveSpeed
second: {r: 9, g: 4.5, b: -8, a: -3.5}
data:
first:
name: _horizonColor
second: {r: 0, g: .125133663, b: .191176474, a: 0}
data:
first:
name: _ColorControl_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: _ColorControlCube_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: BumpParm
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _EdgeColor
second: {r: 0, g: .100000001, b: 0, a: .100000001}
data:
first:
name: _RefTex_0
second: {r: -1517.37024, g: -23.9408531, b: -3154.91675, a: 2715.94165}
data:
first:
name: _RefTex_1
second: {r: 356.584351, g: -313.125671, b: -962.84906, a: 2791.50659}
data:
first:
name: _RefTex_2
second: {r: 4.95644999, g: -.187056601, b: -13.3834057, a: 20.1233597}
data:
first:
name: _RefTex_3
second: {r: 4.95595503, g: -.18703793, b: -13.3820696, a: 20.2213535}
data:
first:
name: horizonColor
second: {r: .61500001, g: .796000004, b: .875999987, a: 1}
data:
first:
name: uvParams
second: {r: 10, g: .0199999996, b: .0299999993, a: 0}
data:
first:
name: waveDirX
second: {r: -2.5, g: 0, b: 7, a: 8}
data:
first:
name: waveDirY
second: {r: 0, g: 1.5, b: -7, a: 1}
data:
first:
name: waveHeights
second: {r: .800000012, g: 1, b: .100000001, a: .0500000007}
data:
first:
name: _WaveSpeed
second: {r: 1, g: -1, b: -1, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -2,3 +2,4 @@ fileFormatVersion: 2
guid: 52b7d70b1de7c4ce09662b77c14d9fda
NativeFormatImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,192 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WaterBasicNighttime
m_Shader: {fileID: 4800000, guid: 9dccc8e8f0da4494991c26ef59019551, type: 3}
m_ShaderKeywords: []
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c2ef94ff9d11915d1100a04b44295342, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: a53cf5449d11a15d1100a04b44295342, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ReflectionTex
second:
m_Texture: {fileID: 8400000, guid: 21bb33409d118354d000dcabe39e7c39, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _WavesTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorControlCube
second:
m_Texture: {fileID: 8900000, guid: 006a5f739d1105f6a000538a2aef8c59, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorControl
second:
m_Texture: {fileID: 2800000, guid: 8403d3349d112ba4d000be1be39e7c39, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap2
second:
m_Texture: {fileID: 2800000, guid: 279fb0a19d11d4a6d00051fa8d76c639, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _ColorGradient
second:
m_Texture: {fileID: 2800000, guid: 8403d3349d112ba4d000be1be39e7c39, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Shininess
second: 1
data:
first:
name: _WaveScale
second: .0702830181
data:
first:
name: _Highlight
second: 33.2075462
data:
first:
name: _bScale
second: .0629245341
data:
first:
name: _BumpPeturb
second: 82.07547
data:
first:
name: _BumpPeturb2
second: .745283008
data:
first:
name: _bTwirl
second: .0500000007
data:
first:
name: _distort
second: .100000001
data:
first:
name: _BumpStrength
second: .100000001
m_Colors:
data:
first:
name: _Color
second: {r: .700785816, g: .481223762, b: .474296182, a: 1}
data:
first:
name: _MainTex_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: _SpecColor
second: {r: 0, g: 0, b: 0, a: .400000006}
data:
first:
name: _BumpMap_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: WaveSpeed
second: {r: 9.68770027, g: 4.81898165, b: -7.91322803, a: 2.87029743}
data:
first:
name: _horizonColor
second: {r: .148485541, g: .282429248, b: .379949659, a: 0}
data:
first:
name: _ColorControl_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: _ColorControlCube_ST
second: {r: 1, g: 1, b: 0, a: 0}
data:
first:
name: BumpParm
second: {r: 1, g: 1, b: -1, a: -1}
data:
first:
name: _EdgeColor
second: {r: 0, g: .100000001, b: 0, a: .100000001}
data:
first:
name: _RefTex_0
second: {r: -1517.37024, g: -23.9408531, b: -3154.91675, a: 2715.94165}
data:
first:
name: _RefTex_1
second: {r: 356.584351, g: -313.125671, b: -962.84906, a: 2791.50659}
data:
first:
name: _RefTex_2
second: {r: 4.95644999, g: -.187056601, b: -13.3834057, a: 20.1233597}
data:
first:
name: _RefTex_3
second: {r: 4.95595503, g: -.18703793, b: -13.3820696, a: 20.2213535}
data:
first:
name: horizonColor
second: {r: .61500001, g: .796000004, b: .875999987, a: 1}
data:
first:
name: uvParams
second: {r: 10, g: .0199999996, b: .0299999993, a: 0}
data:
first:
name: waveDirX
second: {r: -2.5, g: 0, b: 7, a: 8}
data:
first:
name: waveDirY
second: {r: 0, g: 1.5, b: -7, a: 1}
data:
first:
name: waveHeights
second: {r: .800000012, g: 1, b: .100000001, a: .0500000007}
data:
first:
name: _WaveSpeed
second: {r: 1, g: -1, b: -1, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -2,3 +2,4 @@ fileFormatVersion: 2
guid: c55afdc4a8a3b4890b07cc7d176510bb
NativeFormatImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 3
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: WaterDefault
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: []
m_CustomRenderQueue: -1
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c2ef94ff9d11915d1100a04b44295342, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: {}
m_Colors:
data:
first:
name: _Color
second: {r: .5, g: .5, b: .5, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -2,3 +2,4 @@ fileFormatVersion: 2
guid: 30abebfd9bf1c49d8a2d26e61e66bc15
NativeFormatImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5ca387966638baf478f257729f7d9ffd
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: ce8d79c79d11b8f9d00076e98d76c639
ModelImporter:
serializedVersion: 16
serializedVersion: 18
fileIDToRecycleName:
100000: //RootNode
400000: //RootNode
@ -11,16 +11,19 @@ ModelImporter:
4300002: nurbsToPoly1
4300004: pCylinder1
4300006: waterPlaneMesh
4300008: WaterBasicPlane
4300010: WaterSimplePlane
11100000: //RootNode
materials:
importMaterials: 1
materialName: 3
materialSearch: 1
importMaterials: 0
materialName: 1
materialSearch: 2
animations:
legacyGenerateAnimations: 0
bakeSimulation: 0
optimizeGameObjects: 0
motionNodeName:
pivotNodeName:
animationCompression: 1
animationRotationError: .5
animationPositionError: .5
@ -37,13 +40,14 @@ ModelImporter:
importBlendShapes: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
useFileUnits: 0
optimizeMeshForGPU: 1
weldVertices: 1
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 0
tangentSpace:
normalSmoothAngle: 60
splitTangentsAcrossUV: 0
@ -64,5 +68,6 @@ ModelImporter:
rootMotionBoneName:
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 1
additionalBone: 1
additionalBone: 0
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 50d95e01ce44ff842949168ffec200cf
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,104 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 23: {fileID: 2300000}
- 114: {fileID: 11400000}
m_Layer: 4
m_Name: WaterBasicDaytime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1002 &100001
EditorExtensionImpl:
serializedVersion: 6
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1002 &400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_LightmapIndex: 255
m_LightmapIndexDynamic: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_LightmapTilingOffsetDynamic: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: 52b7d70b1de7c4ce09662b77c14d9fda, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_UseReflectionProbes: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_EnlightenSystemBuildParameters: {fileID: 0}
m_GIBackfaceCull: 0
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!1002 &2300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 4300008, guid: ce8d79c79d11b8f9d00076e98d76c639, type: 3}
--- !u!1002 &3300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d2f50a8e0bb841a5aaa90ae55db8849, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1002 &11400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1
--- !u!1002 &100100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -2,3 +2,4 @@ fileFormatVersion: 2
guid: 9485b0c79d11e2e4d0007da98d76c639
NativeFormatImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,104 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 4
m_Component:
- 4: {fileID: 400000}
- 33: {fileID: 3300000}
- 23: {fileID: 2300000}
- 114: {fileID: 11400000}
m_Layer: 4
m_Name: WaterBasicNightime
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1002 &100001
EditorExtensionImpl:
serializedVersion: 6
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.10330009, y: 10.3140001, z: -40.5900002}
m_LocalScale: {x: 16, y: 1, z: 16}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1002 &400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_LightmapIndex: 255
m_LightmapIndexDynamic: 255
m_LightmapTilingOffset: {x: 1, y: 1, z: 0, w: 0}
m_LightmapTilingOffsetDynamic: {x: 1, y: 1, z: 0, w: 0}
m_Materials:
- {fileID: 2100000, guid: c55afdc4a8a3b4890b07cc7d176510bb, type: 2}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_UseLightProbes: 0
m_UseReflectionProbes: 1
m_ProbeAnchor: {fileID: 0}
m_ScaleInLightmap: 1
m_EnlightenSystemBuildParameters: {fileID: 0}
m_GIBackfaceCull: 0
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!1002 &2300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 4300008, guid: ce8d79c79d11b8f9d00076e98d76c639, type: 3}
--- !u!1002 &3300001
EditorExtensionImpl:
serializedVersion: 6
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0d2f50a8e0bb841a5aaa90ae55db8849, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1002 &11400001
EditorExtensionImpl:
serializedVersion: 6
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1
--- !u!1002 &100100001
EditorExtensionImpl:
serializedVersion: 6

View File

@ -2,3 +2,4 @@ fileFormatVersion: 2
guid: 6b436d069d11415d1100ab9b44295342
NativeFormatImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8c2faca551f48fa43bd5cbf1951243b2
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using System;
using UnityEngine;
namespace UnityStandardAssets.Water
{
[ExecuteInEditMode]
public class WaterBasic : MonoBehaviour
{
void Update()
{
Renderer r = GetComponent<Renderer>();
if (!r)
{
return;
}
Material mat = r.sharedMaterial;
if (!mat)
{
return;
}
Vector4 waveSpeed = mat.GetVector("WaveSpeed");
float waveScale = mat.GetFloat("_WaveScale");
float t = Time.time / 20.0f;
Vector4 offset4 = waveSpeed * (t * waveScale);
Vector4 offsetClamped = new Vector4(Mathf.Repeat(offset4.x, 1.0f), Mathf.Repeat(offset4.y, 1.0f),
Mathf.Repeat(offset4.z, 1.0f), Mathf.Repeat(offset4.w, 1.0f));
mat.SetVector("_WaveOffset", offsetClamped);
}
}
}

View File

@ -6,3 +6,4 @@ MonoImporter:
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c18f45882d2f44845b278168ae59bbc9
folderAsset: yes
timeCreated: 1425647540
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,88 @@
Shader "FX/Water (Basic)" {
Properties {
_horizonColor ("Horizon color", COLOR) = ( .172 , .463 , .435 , 0)
_WaveScale ("Wave scale", Range (0.02,0.15)) = .07
[NoScaleOffset] _ColorControl ("Reflective color (RGB) fresnel (A) ", 2D) = "" { }
[NoScaleOffset] _BumpMap ("Waves Normalmap ", 2D) = "" { }
WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7)
}
CGINCLUDE
#include "UnityCG.cginc"
uniform float4 _horizonColor;
uniform float4 WaveSpeed;
uniform float _WaveScale;
uniform float4 _WaveOffset;
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f {
float4 pos : SV_POSITION;
float2 bumpuv[2] : TEXCOORD0;
float3 viewDir : TEXCOORD2;
UNITY_FOG_COORDS(3)
};
v2f vert(appdata v)
{
v2f o;
float4 s;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
// scroll bump waves
float4 temp;
float4 wpos = mul (_Object2World, v.vertex);
temp.xyzw = wpos.xzxz * _WaveScale + _WaveOffset;
o.bumpuv[0] = temp.xy * float2(.4, .45);
o.bumpuv[1] = temp.wz;
// object space view direction
o.viewDir.xzy = normalize( WorldSpaceViewDir(v.vertex) );
UNITY_TRANSFER_FOG(o,o.pos);
return o;
}
ENDCG
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
sampler2D _BumpMap;
sampler2D _ColorControl;
half4 frag( v2f i ) : COLOR
{
half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[0] )).rgb;
half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[1] )).rgb;
half3 bump = (bump1 + bump2) * 0.5;
half fresnel = dot( i.viewDir, bump );
half4 water = tex2D( _ColorControl, float2(fresnel,fresnel) );
half4 col;
col.rgb = lerp( water.rgb, _horizonColor.rgb, water.a );
col.a = _horizonColor.a;
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}

View File

@ -3,3 +3,4 @@ guid: 9dccc8e8f0da4494991c26ef59019551
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d0a7f7db15b0ffd4799a10e46cd39917
folderAsset: yes
timeCreated: 1425647541
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -20,6 +20,9 @@ TextureImporter:
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 32
@ -30,6 +33,7 @@ TextureImporter:
wrapMode: 1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
@ -45,3 +49,4 @@ TextureImporter:
sprites: []
spritePackingTag:
userData:
assetBundleName:

View File

@ -20,6 +20,9 @@ TextureImporter:
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 32
@ -30,6 +33,7 @@ TextureImporter:
wrapMode: 1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
@ -45,3 +49,4 @@ TextureImporter:
sprites: []
spritePackingTag:
userData:
assetBundleName:

View File

@ -20,16 +20,20 @@ TextureImporter:
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 512
textureSettings:
filterMode: 1
aniso: 3
filterMode: 2
aniso: 1
mipBias: 0
wrapMode: 0
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
@ -40,8 +44,25 @@ TextureImporter:
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: 1
buildTargetSettings: []
buildTargetSettings:
- buildTarget: iPhone
maxTextureSize: 256
textureFormat: -1
compressionQuality: 50
- buildTarget: Android
maxTextureSize: 256
textureFormat: -1
compressionQuality: 50
- buildTarget: BlackBerry
maxTextureSize: 256
textureFormat: -1
compressionQuality: 50
- buildTarget: WP8
maxTextureSize: 256
textureFormat: -1
compressionQuality: 50
spriteSheet:
sprites: []
spritePackingTag:
userData:
assetBundleName:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: dc7abfa0435174ded902b073322d67cc
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 70a4c3571f5624280bd8605def97056d
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 706eadfad28bc4c1c9bb137b31052b14
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 2fd60b04f7c434a4dafd253d09bfa783
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 40b01469ebddf42bc84870ba2f3d8c4c
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: ac85670a1b2274f22905d6a43940371a
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,32 +0,0 @@
using UnityEngine;
// Sets up transformation matrices to scale&scroll water waves
// for the case where graphics card does not support vertex programs.
[ExecuteInEditMode]
public class WaterSimple : MonoBehaviour
{
void Update()
{
if( !GetComponent<Renderer>() )
return;
Material mat = GetComponent<Renderer>().sharedMaterial;
if( !mat )
return;
Vector4 waveSpeed = mat.GetVector( "WaveSpeed" );
float waveScale = mat.GetFloat( "_WaveScale" );
float t = Time.time / 20.0f;
Vector4 offset4 = waveSpeed * (t * waveScale);
Vector4 offsetClamped = new Vector4(Mathf.Repeat(offset4.x,1.0f), Mathf.Repeat(offset4.y,1.0f), Mathf.Repeat(offset4.z,1.0f), Mathf.Repeat(offset4.w,1.0f));
mat.SetVector( "_WaveOffset", offsetClamped );
Vector3 scale = new Vector3( 1.0f/waveScale, 1.0f/waveScale, 1 );
Matrix4x4 scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.x,offsetClamped.y,0), Quaternion.identity, scale );
mat.SetMatrix( "_WaveMatrix", scrollMatrix );
scrollMatrix = Matrix4x4.TRS( new Vector3(offsetClamped.z,offsetClamped.w,0), Quaternion.identity, scale * 0.45f );
mat.SetMatrix( "_WaveMatrix2", scrollMatrix );
}
}

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: c8e96a067d1ef4982b454cf5a686f648
folderAsset: yes
DefaultImporter:
userData:

View File

@ -1,140 +0,0 @@
Shader "FX/Water (simple)" {
Properties {
_horizonColor ("Horizon color", COLOR) = ( .172 , .463 , .435 , 0)
_WaveScale ("Wave scale", Range (0.02,0.15)) = .07
_ColorControl ("Reflective color (RGB) fresnel (A) ", 2D) = "" { }
_ColorControlCube ("Reflective color cube (RGB) fresnel (A) ", Cube) = "" { TexGen CubeReflect }
_BumpMap ("Waves Normalmap ", 2D) = "" { }
WaveSpeed ("Wave speed (map1 x,y; map2 x,y)", Vector) = (19,9,-16,-7)
_MainTex ("Fallback texture", 2D) = "" { }
}
CGINCLUDE
// -----------------------------------------------------------
// This section is included in all program sections below
#include "UnityCG.cginc"
uniform float4 _horizonColor;
uniform float4 WaveSpeed;
uniform float _WaveScale;
uniform float4 _WaveOffset;
struct appdata {
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f {
float4 pos : SV_POSITION;
float2 bumpuv[2] : TEXCOORD0;
float3 viewDir : TEXCOORD2;
};
v2f vert(appdata v)
{
v2f o;
float4 s;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
// scroll bump waves
float4 temp;
temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset;
o.bumpuv[0] = temp.xy * float2(.4, .45);
o.bumpuv[1] = temp.wz;
// object space view direction
o.viewDir.xzy = normalize( ObjSpaceViewDir(v.vertex) );
return o;
}
ENDCG
// -----------------------------------------------------------
// Fragment program
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
sampler2D _BumpMap;
sampler2D _ColorControl;
half4 frag( v2f i ) : COLOR
{
half3 bump1 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[0] )).rgb;
half3 bump2 = UnpackNormal(tex2D( _BumpMap, i.bumpuv[1] )).rgb;
half3 bump = (bump1 + bump2) * 0.5;
half fresnel = dot( i.viewDir, bump );
half4 water = tex2D( _ColorControl, float2(fresnel,fresnel) );
half4 col;
col.rgb = lerp( water.rgb, _horizonColor.rgb, water.a );
col.a = _horizonColor.a;
return col;
}
ENDCG
}
}
// -----------------------------------------------------------
// Old cards
// three texture, cubemaps
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
Color (0.5,0.5,0.5,0.5)
SetTexture [_MainTex] {
Matrix [_WaveMatrix]
combine texture * primary
}
SetTexture [_MainTex] {
Matrix [_WaveMatrix2]
combine texture * primary + previous
}
SetTexture [_ColorControlCube] {
combine texture +- previous, primary
Matrix [_Reflection]
}
}
}
// dual texture, cubemaps
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
Color (0.5,0.5,0.5,0.5)
SetTexture [_MainTex] {
Matrix [_WaveMatrix]
combine texture
}
SetTexture [_ColorControlCube] {
combine texture +- previous, primary
Matrix [_Reflection]
}
}
}
// single texture
Subshader {
Tags { "RenderType"="Opaque" }
Pass {
Color (0.5,0.5,0.5,0)
SetTexture [_MainTex] {
Matrix [_WaveMatrix]
combine texture, primary
}
}
}
}

View File

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 33850b67ffcaa4b6c9a7146e4be0b917
folderAsset: yes
DefaultImporter:
userData:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

View File

@ -1,47 +0,0 @@
fileFormatVersion: 2
guid: c2ef94ff9d11915d1100a04b44295342
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 2
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 512
textureSettings:
filterMode: 1
aniso: 1
mipBias: 0
wrapMode: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: 0
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

View File

@ -1,48 +0,0 @@
fileFormatVersion: 2
guid: 006a5f739d1105f6a000538a2aef8c59
TextureImporter:
fileIDToRecycleName:
8900000: generatedCubemap
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 2
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .100000001
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 3
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 32
textureSettings:
filterMode: 1
aniso: 1
mipBias: 0
wrapMode: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

View File

@ -1,48 +0,0 @@
fileFormatVersion: 2
guid: 98c330f39d11745ad0004adb8d76c639
TextureImporter:
fileIDToRecycleName:
8900000: generatedCubemap
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 2
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .100000001
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 3
seamlessCubemap: 0
textureFormat: 12
maxTextureSize: 32
textureSettings:
filterMode: 1
aniso: 1
mipBias: 0
wrapMode: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

View File

@ -1,7 +1,20 @@
fileFormatVersion: 2
guid: 4e25b9a3d527f7a4eb6c14cd8d61012b
MonoAssemblyImporter:
timeCreated: 1425647041
licenseType: Free
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
unityRebuildLibraryVersion: 10
unityForwardCompatibleVersion: 40

Binary file not shown.

View File

@ -0,0 +1,2 @@
0000.54eca922.0000
0000.54eca946.0000

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More