├── .gitignore ├── Assets ├── Editor.meta ├── Editor │ ├── FogOfWarEffectEditor.cs │ └── FogOfWarEffectEditor.cs.meta ├── Materials.meta ├── Materials │ ├── Textures.meta │ ├── Textures │ │ ├── Ground_04.jpg │ │ ├── Ground_04.jpg.meta │ │ ├── Ground_04_nmp.jpg │ │ ├── Ground_04_nmp.jpg.meta │ │ ├── Ground_05.jpg │ │ ├── Ground_05.jpg.meta │ │ ├── Ground_05_nmp.jpg │ │ ├── Ground_05_nmp.jpg.meta │ │ ├── ground1.png │ │ ├── ground1.png.meta │ │ ├── ground9.png │ │ └── ground9.png.meta │ ├── building.mat │ ├── building.mat.meta │ ├── enemy.mat │ ├── enemy.mat.meta │ ├── friendly.mat │ ├── friendly.mat.meta │ ├── mp.mat │ └── mp.mat.meta ├── Scenes.meta ├── Scenes │ ├── Example.meta │ ├── Example │ │ ├── NavMesh.asset │ │ └── NavMesh.asset.meta │ ├── Example0.meta │ ├── Example0.unity │ ├── Example0.unity.meta │ ├── Example0 │ │ ├── NavMesh.asset │ │ └── NavMesh.asset.meta │ ├── Example1.meta │ ├── Example1.unity │ ├── Example1.unity.meta │ └── Example1 │ │ ├── NavMesh.asset │ │ └── NavMesh.asset.meta ├── Scripts.meta ├── Scripts │ ├── FogOfWar.meta │ ├── FogOfWar │ │ ├── Core.meta │ │ ├── Core │ │ │ ├── FOWMap.cs │ │ │ ├── FOWMap.cs.meta │ │ │ ├── FOWMapData.cs │ │ │ ├── FOWMapData.cs.meta │ │ │ ├── FOWMaskTexture.cs │ │ │ ├── FOWMaskTexture.cs.meta │ │ │ ├── FOWPregenerationMapData.cs │ │ │ ├── FOWPregenerationMapData.cs.meta │ │ │ ├── FOWRenderer.cs │ │ │ ├── FOWRenderer.cs.meta │ │ │ ├── FOWUtils.cs │ │ │ ├── FOWUtils.cs.meta │ │ │ ├── MaskCalcluater.meta │ │ │ └── MaskCalcluater │ │ │ │ ├── CircularMask.cs │ │ │ │ ├── CircularMask.cs.meta │ │ │ │ ├── FOVAccurate.cs │ │ │ │ ├── FOVAccurate.cs.meta │ │ │ │ ├── FOVCalculator.cs │ │ │ │ ├── FOVCalculator.cs.meta │ │ │ │ ├── FOVSimple.cs │ │ │ │ ├── FOVSimple.cs.meta │ │ │ │ ├── MaskCalcluatorBase.cs │ │ │ │ └── MaskCalcluatorBase.cs.meta │ │ ├── FogOfWarEffect.cs │ │ ├── FogOfWarEffect.cs.meta │ │ ├── FogOfWarExplorer.cs │ │ ├── FogOfWarExplorer.cs.meta │ │ ├── FogOfWarStalker.cs │ │ └── FogOfWarStalker.cs.meta │ ├── Test.meta │ └── Test │ │ ├── TestAI.cs │ │ ├── TestAI.cs.meta │ │ ├── TestController.cs │ │ ├── TestController.cs.meta │ │ ├── TestMiniMap.cs │ │ ├── TestMiniMap.cs.meta │ │ ├── TestPlayer.cs │ │ └── TestPlayer.cs.meta ├── Shaders.meta ├── Shaders │ ├── FogOfWarBlur.shader │ ├── FogOfWarBlur.shader.meta │ ├── FogOfWarEffect.shader │ ├── FogOfWarEffect.shader.meta │ ├── FogOfWarMinimap.shader │ └── FogOfWarMinimap.shader.meta ├── Terrain.meta ├── Terrain │ ├── New Terrain.asset │ ├── New Terrain.asset.meta │ ├── New Terrain2.asset │ ├── New Terrain2.asset.meta │ ├── t.asset │ └── t.asset.meta ├── Textures.meta └── Textures │ ├── UI.meta │ └── UI │ ├── map.jpg │ ├── map.jpg.meta │ ├── minimap.png │ ├── minimap.png.meta │ ├── minimapmask.png │ └── minimapmask.png.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── doc ├── fog_0.gif ├── fog_1.gif └── preview.JPG /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio 2015 cache directory 9 | /.vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | *.unitypackage 35 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07c241d151477d942a87f4664171cb5b 3 | folderAsset: yes 4 | timeCreated: 1509782245 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/FogOfWarEffectEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | [CustomEditor(typeof(FogOfWarEffect))] 7 | public class FogOfWarEffectEditor : Editor 8 | { 9 | private FogOfWarEffect m_Target; 10 | 11 | void OnEnable() 12 | { 13 | m_Target = (FogOfWarEffect) target; 14 | } 15 | 16 | public override bool HasPreviewGUI() 17 | { 18 | if (m_Target == null) 19 | return false; 20 | return m_Target.fowMaskTexture != null; 21 | } 22 | 23 | public override void OnInspectorGUI() 24 | { 25 | base.OnInspectorGUI(); 26 | EditorGUILayout.Space(); 27 | 28 | if (GUILayout.Button("预生成地图数据")) 29 | { 30 | ASL.FogOfWar.FOWPregenerationMapData dt = m_Target.GetComponent(); 31 | if (!dt) 32 | dt = m_Target.gameObject.AddComponent(); 33 | if (dt) 34 | { 35 | dt.width = m_Target.texWidth; 36 | dt.height = m_Target.texHeight; 37 | float deltax = m_Target.xSize / m_Target.texWidth; 38 | float deltaz = m_Target.zSize / m_Target.texHeight; 39 | Vector3 beginpos = m_Target.centerPosition - new Vector3(m_Target.xSize * 0.5f, 0, m_Target.zSize * 0.5f); 40 | dt.GenerateMapData(beginpos.x, beginpos.y, deltax, deltaz, m_Target.heightRange); 41 | } 42 | } 43 | } 44 | 45 | public override void DrawPreview(Rect previewArea) 46 | { 47 | base.DrawPreview(previewArea); 48 | if (m_Target != null && m_Target.fowMaskTexture) 49 | GUI.DrawTexture(previewArea, m_Target.fowMaskTexture); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Editor/FogOfWarEffectEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 098ac8b40f004624ca7ec4c79296d6ff 3 | timeCreated: 1509782264 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c74e24fac2d72149b6d35e3e87246d6 3 | folderAsset: yes 4 | timeCreated: 1509373834 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4db17ccac4760a64fbc265bc067cd4fd 3 | folderAsset: yes 4 | timeCreated: 1509373838 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/Ground_04.jpg -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_04.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba7efc24d4cf5104d9b0212c373197d5 3 | timeCreated: 1515686703 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_04_nmp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/Ground_04_nmp.jpg -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_04_nmp.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24af86545ecaaca4893b01e0c075a819 3 | timeCreated: 1515686696 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 1 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_05.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/Ground_05.jpg -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_05.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 200188c2c50abbb43bb403dda4a7a59e 3 | timeCreated: 1515686692 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_05_nmp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/Ground_05_nmp.jpg -------------------------------------------------------------------------------- /Assets/Materials/Textures/Ground_05_nmp.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b7c176954ee6ef499d6054d8ffc14b3 3 | timeCreated: 1515686699 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 1 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/ground1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/ground1.png -------------------------------------------------------------------------------- /Assets/Materials/Textures/ground1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f7f9374d1c27c34d8de0b9e22181067 3 | timeCreated: 1509373892 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Materials/Textures/ground9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Materials/Textures/ground9.png -------------------------------------------------------------------------------- /Assets/Materials/Textures/ground9.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dbd10c3b62f8b045a146d188b4be30a 3 | timeCreated: 1509373892 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 0 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 0 46 | spriteTessellationDetail: -1 47 | textureType: 0 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | spriteSheet: 62 | serializedVersion: 2 63 | sprites: [] 64 | outline: [] 65 | spritePackingTag: 66 | userData: 67 | assetBundleName: 68 | assetBundleVariant: 69 | -------------------------------------------------------------------------------- /Assets/Materials/building.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: building 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.43382353, g: 0.43382353, b: 0.43382353, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Materials/building.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a32f38dfe4aacb7429ea57fbb2a8f9a0 3 | timeCreated: 1509765622 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/enemy.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: enemy 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 0, b: 0, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Materials/enemy.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77e51dc13cd04564da2df8cb06c57cd7 3 | timeCreated: 1509731322 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/friendly.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: friendly 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.15862082, g: 1, b: 0, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Materials/friendly.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9a36a28969484241a1873e6bc6948ef 3 | timeCreated: 1509731510 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Materials/mp.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: mp 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.10602294, g: 0.34275144, b: 0.3897059, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/Materials/mp.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3a910035ee13fa47a01e99211861ffe 3 | timeCreated: 1509774070 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0afebf3fada7fb644b7ab122887cb8b5 3 | folderAsset: yes 4 | timeCreated: 1509373818 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ae827a00f3a9034dbd7956513e2c4a9 3 | folderAsset: yes 4 | timeCreated: 1509727099 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example/NavMesh.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Scenes/Example/NavMesh.asset -------------------------------------------------------------------------------- /Assets/Scenes/Example/NavMesh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 348bfc13c62ec9948b9643b9d1faeb15 3 | timeCreated: 1509771924 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 23800000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example0.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 50f2f5224f130e144922a86088fdfc0e 3 | folderAsset: yes 4 | timeCreated: 1515752449 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example0.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29cd0f7e9efcf594b84bcb01e521efe4 3 | timeCreated: 1509774036 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/Example0/NavMesh.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Scenes/Example0/NavMesh.asset -------------------------------------------------------------------------------- /Assets/Scenes/Example0/NavMesh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce3e37492f69f404cb51dbafc0ed7604 3 | timeCreated: 1515752449 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 23800000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example1.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73feb2add80199b4ba56218023e278df 3 | folderAsset: yes 4 | timeCreated: 1509773997 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Example1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d5f28feb317edf4db9489bd28978f41 3 | timeCreated: 1509773987 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/Example1/NavMesh.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Scenes/Example1/NavMesh.asset -------------------------------------------------------------------------------- /Assets/Scenes/Example1/NavMesh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b68dfa5e9a5200340bd0043bcb9bd0a6 3 | timeCreated: 1515750255 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 23800000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2162f61a28eef0d41a5620e1049df69b 3 | folderAsset: yes 4 | timeCreated: 1509374654 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57ee6d5b9d090664c83f4d3f1fccc2ac 3 | folderAsset: yes 4 | timeCreated: 1509376291 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9934c87938a79114a8bd60c1f97c29e5 3 | folderAsset: yes 4 | timeCreated: 1509376323 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System.Threading; 5 | 6 | namespace ASL.FogOfWar 7 | { 8 | /// 9 | /// 战争迷雾地图类 10 | /// 11 | internal class FOWMap 12 | { 13 | /// 14 | /// 地图数据(1表示障碍物) 15 | /// 16 | public IFOWMapData mapData { get { return m_MapData; } } 17 | 18 | public FOWMaskTexture maskTexture { get { return m_MaskTexture; } } 19 | 20 | public Vector3 beginPosition { get { return m_BeginPosition; } } 21 | 22 | public float deltaX { get { return m_DeltaX; } } 23 | 24 | public float deltaZ { get { return m_DeltaZ; } } 25 | 26 | public float invDeltaX { get { return m_InvDeltaX; } } 27 | 28 | public float invDeltaZ { get { return m_InvDeltaZ; } } 29 | public int texWidth { get { return m_TexWidth; } } 30 | public int texHeight { get { return m_TexHdight; } } 31 | 32 | private IFOWMapData m_MapData; 33 | 34 | /// 35 | /// 迷雾纹理 36 | /// 37 | private FOWMaskTexture m_MaskTexture; 38 | 39 | //private float[] m_SortAngle = new float[4]; 40 | 41 | /// 42 | /// 在线程池中计算FOV 43 | /// 44 | private WaitCallback m_FOVCalculator; 45 | 46 | private Vector3 m_BeginPosition; 47 | 48 | private float m_DeltaX; 49 | private float m_DeltaZ; 50 | private float m_InvDeltaX; 51 | private float m_InvDeltaZ; 52 | private int m_TexWidth; 53 | private int m_TexHdight; 54 | 55 | /// 56 | /// FOV计算器 57 | /// 58 | private MaskCalcluatorBase m_CalculaterBase; 59 | 60 | private object m_Lock; 61 | 62 | public FOWMap(FogOfWarEffect.FogMaskType fogMaskType, Vector3 begionPosition, float xSize, float zSize, int texWidth, int texHeight, float heightRange) 63 | { 64 | m_FOVCalculator = new WaitCallback(this.CalculateFOV); 65 | 66 | //m_MapData = new FOWMapData(texWidth, texHeight);//new byte[texWidth, texHeight]; 67 | m_MaskTexture = new FOWMaskTexture(texWidth, texHeight); 68 | 69 | m_DeltaX = xSize / texWidth; 70 | m_DeltaZ = zSize / texHeight; 71 | m_InvDeltaX = 1.0f/m_DeltaX; 72 | m_InvDeltaZ = 1.0f/m_DeltaZ; 73 | m_BeginPosition = begionPosition; 74 | m_TexWidth = texWidth; 75 | m_TexHdight = texHeight; 76 | 77 | m_CalculaterBase = CreateCalculator(fogMaskType); 78 | 79 | //GenerateMapData(heightRange); 80 | 81 | m_Lock = new object(); 82 | } 83 | 84 | public void SetMapData(IFOWMapData mapData) 85 | { 86 | Debug.Log(mapData.GetType()); 87 | this.m_MapData = mapData; 88 | } 89 | 90 | /// 91 | /// 生成地图数据 92 | /// 93 | /// 高度范围 94 | public void GenerateMapData(float heightRange) 95 | { 96 | m_MapData.GenerateMapData(beginPosition.x, beginPosition.y, m_DeltaX, m_DeltaZ, heightRange); 97 | } 98 | 99 | /// 100 | /// 刷新战争迷雾纹理,成功则返回true 101 | /// 102 | /// 103 | public bool RefreshFOWTexture() 104 | { 105 | lock (m_Lock) 106 | { 107 | return m_MaskTexture.RefreshTexture(); 108 | } 109 | } 110 | 111 | /// 112 | /// 获得战争迷雾纹理 113 | /// 114 | /// 115 | public Texture2D GetFOWTexture() 116 | { 117 | return m_MaskTexture.texture; 118 | } 119 | 120 | /// 121 | /// 根据视野数据设置可见 122 | /// 123 | /// 视野数据 124 | //public void SetVisible(FOWFieldData fieldData) 125 | public void SetVisible(List fieldDatas) 126 | { 127 | //lock (m_Lock) 128 | { 129 | ThreadPool.QueueUserWorkItem(m_FOVCalculator, fieldDatas); 130 | } 131 | } 132 | 133 | /// 134 | /// 指定坐标是否在地图中可见 135 | /// 136 | /// 137 | /// 138 | /// 139 | public bool IsVisibleInMap(int x, int z) 140 | { 141 | return m_MaskTexture.IsVisible(x, z); 142 | } 143 | 144 | public void Release() 145 | { 146 | lock (m_Lock) 147 | { 148 | if (m_MaskTexture != null) 149 | m_MaskTexture.Release(); 150 | m_MaskTexture = null; 151 | m_MapData = null; 152 | m_CalculaterBase.Release(); 153 | m_CalculaterBase = null; 154 | m_FOVCalculator = null; 155 | } 156 | m_Lock = null; 157 | } 158 | 159 | /// 160 | /// 在子线程计算视野 161 | /// 162 | /// 参数(视野数据) 163 | private void CalculateFOV(object state) 164 | { 165 | if (state == null) 166 | return; 167 | var dt = (List)state; 168 | lock (m_Lock) 169 | { 170 | for (int i = 0; i < dt.Count; i++) 171 | { 172 | if (dt[i] == null) 173 | continue; 174 | m_CalculaterBase.Calculate(dt[i], this); 175 | } 176 | m_MaskTexture.MarkAsUpdated(); 177 | } 178 | } 179 | 180 | 181 | private MaskCalcluatorBase CreateCalculator(FogOfWarEffect.FogMaskType maskType) 182 | { 183 | switch (maskType) 184 | { 185 | case FogOfWarEffect.FogMaskType.AccurateFOV: 186 | return new FOVAccurate(); 187 | case FogOfWarEffect.FogMaskType.BasicFOV: 188 | return new FOVSimple(); 189 | case FogOfWarEffect.FogMaskType.Circular: 190 | return new CircularMask(); 191 | default: 192 | return null; 193 | } 194 | } 195 | } 196 | 197 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7f79fabdd44050a47a05544a4d6e8cf3 3 | timeCreated: 1509376319 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMapData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | public interface IFOWMapData 8 | { 9 | /// 10 | /// 地图数据是否为预生成 11 | /// 12 | bool isPregeneration { get; } 13 | 14 | void GenerateMapData(float beginx, float beginy, float deltax, float deltay, float heightRange); 15 | 16 | bool this[int i, int j] { get; } 17 | } 18 | 19 | public class FOWMapData : IFOWMapData 20 | { 21 | public bool isPregeneration 22 | { 23 | get { return false; } 24 | } 25 | 26 | public int width 27 | { 28 | get { return m_Width; } 29 | } 30 | 31 | public int height 32 | { 33 | get { return m_Height; } 34 | } 35 | 36 | public bool this[int i, int j] 37 | { 38 | get 39 | { 40 | return m_MapData[i, j]; 41 | 42 | } 43 | } 44 | 45 | private bool[,] m_MapData; 46 | 47 | private int m_Width; 48 | private int m_Height; 49 | 50 | public FOWMapData(int width, int height) 51 | { 52 | m_MapData = new bool[width, height]; 53 | m_Width = width; 54 | m_Height = height; 55 | } 56 | 57 | public void GenerateMapData(float beginx, float beginy, float deltax, float deltay, float heightRange) 58 | { 59 | for (int i = 0; i < m_Width; i++) 60 | { 61 | for (int j = 0; j < m_Height; j++) 62 | { 63 | m_MapData[i, j] = FOWUtils.IsObstacle(beginx, beginy, deltax, deltay, heightRange, i, j); 64 | } 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMapData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c59ea4effa901db4bb46065ed11d8a49 3 | timeCreated: 1517749213 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMaskTexture.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace ASL.FogOfWar 5 | { 6 | /// 7 | /// 战争迷雾纹理类 8 | /// 9 | internal class FOWMaskTexture 10 | { 11 | private enum UpdateMark 12 | { 13 | None, 14 | Changed, 15 | EndUpdate, 16 | } 17 | 18 | /// 19 | /// 战争迷雾纹理:R通道叠加所有已探索区域,G通道为当前更新的可见区域,B通道为上一次更新的可见区域 20 | /// 21 | public Texture2D texture 22 | { 23 | get { return m_MaskTexture; } 24 | } 25 | 26 | private Texture2D m_MaskTexture; 27 | 28 | private byte[] m_MaskCache; 29 | //private byte[,] m_Visible; 30 | private Color[] m_ColorBuffer; 31 | 32 | //private bool m_IsUpdated; 33 | private UpdateMark m_UpdateMark; 34 | 35 | private int m_Width; 36 | private int m_Height; 37 | 38 | public FOWMaskTexture(int width, int height) 39 | { 40 | m_Width = width; 41 | m_Height = height; 42 | m_MaskCache = new byte[width* height]; 43 | m_ColorBuffer = new Color[width*height]; 44 | //m_Visible = new byte[width, height]; 45 | } 46 | 47 | public void SetAsVisible(int x, int y) 48 | { 49 | // m_MaskCache[x, y] = 1; 50 | m_MaskCache[y*m_Width + x] = 1; 51 | m_UpdateMark = UpdateMark.Changed; 52 | } 53 | 54 | public void MarkAsUpdated() 55 | { 56 | if (m_UpdateMark != UpdateMark.Changed) 57 | { 58 | m_UpdateMark = UpdateMark.EndUpdate; 59 | 60 | } 61 | else 62 | { 63 | for (int i = 0; i < m_Width; i++) 64 | { 65 | for (int j = 0; j < m_Height; j++) 66 | { 67 | bool isVisible = m_MaskCache[j * m_Width + i] == 1; 68 | Color origin = m_ColorBuffer[j * m_Width + i]; 69 | origin.r = Mathf.Clamp01(origin.r + origin.g); 70 | origin.b = origin.g; 71 | origin.g = isVisible ? 1 : 0; 72 | m_ColorBuffer[j * m_Width + i] = origin; 73 | //m_Visible[i, j] = (byte)(isVisible ? 1 : 0); 74 | m_MaskCache[j * m_Width + i] = 0; 75 | } 76 | } 77 | } 78 | } 79 | 80 | public bool IsVisible(int x, int y) 81 | { 82 | if (x < 0 || x >= m_Width || y < 0 || y >= m_Height) 83 | return false; 84 | return m_ColorBuffer[y*m_Width + x].g > 0.5f; 85 | //return m_Visible[x, y] == 1; 86 | } 87 | 88 | public bool RefreshTexture() 89 | { 90 | if (m_UpdateMark == UpdateMark.None) 91 | return false; 92 | if (m_UpdateMark == UpdateMark.EndUpdate) 93 | return true; 94 | //bool isNew = false; 95 | if (m_MaskTexture == null) 96 | { 97 | m_MaskTexture = GenerateTexture(); 98 | //isNew = true; 99 | } 100 | //for (int i = 0; i < m_MaskTexture.width; i++) 101 | //{ 102 | // for (int j = 0; j < m_MaskTexture.height; j++) 103 | // { 104 | // bool isVisible = m_MaskCache[i, j] == 1; 105 | // Color origin = isNew ? Color.black : m_MaskTexture.GetPixel(i, j); 106 | // origin.r = Mathf.Clamp01(origin.r + origin.g); 107 | // origin.b = origin.g; 108 | // origin.g = isVisible ? 1 : 0; 109 | // m_MaskTexture.SetPixel(i, j, origin); 110 | // m_Visible[i, j] = (byte) (isVisible ? 1 : 0); 111 | // m_MaskCache[i, j] = 0; 112 | // } 113 | //} 114 | m_MaskTexture.SetPixels(m_ColorBuffer); 115 | m_MaskTexture.Apply(); 116 | m_UpdateMark = UpdateMark.None; 117 | return true; 118 | } 119 | 120 | public void Release() 121 | { 122 | if (m_MaskTexture != null) 123 | Object.Destroy(m_MaskTexture); 124 | m_MaskTexture = null; 125 | m_MaskCache = null; 126 | m_ColorBuffer = null; 127 | //m_Visible = null; 128 | } 129 | 130 | private Texture2D GenerateTexture() 131 | { 132 | Texture2D tex = new Texture2D(m_Width, m_Height, TextureFormat.RGB24, false); 133 | tex.wrapMode = TextureWrapMode.Clamp; 134 | //for (int i = 0; i < tex.width; i++) 135 | //{ 136 | // for (int j = 0; j < tex.height; j++) 137 | // { 138 | // m_ColorBuffer[j*m_Width + i] = Color.black; 139 | // } 140 | //} 141 | return tex; 142 | } 143 | } 144 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWMaskTexture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2500ea0e394e27549922c3c3f79ab8bd 3 | timeCreated: 1509461607 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWPregenerationMapData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | [System.Serializable] 8 | public class FOWPregenerationMapData : MonoBehaviour, IFOWMapData 9 | { 10 | public bool isPregeneration 11 | { 12 | get { return false; } 13 | } 14 | 15 | public bool this[int i, int j] 16 | { 17 | get { return m_MapData[j * width + i]; } 18 | } 19 | 20 | public int width; 21 | public int height; 22 | [SerializeField] 23 | private bool[] m_MapData; 24 | 25 | public void GenerateMapData(float beginx, float beginy, float deltax, float deltay, float heightRange) 26 | { 27 | m_MapData = new bool[width*height]; 28 | for (int i = 0; i < width; i++) 29 | { 30 | for (int j = 0; j < height; j++) 31 | { 32 | m_MapData[j* width + i] = FOWUtils.IsObstacle(beginx, beginy, deltax, deltay, heightRange, i, j); 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWPregenerationMapData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51e188c0269d4f54db3fc2a574bea4ac 3 | timeCreated: 1517749878 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWRenderer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | /// 8 | /// 战争迷雾屏幕特效渲染器 9 | /// 10 | internal class FOWRenderer 11 | { 12 | 13 | private Material m_EffectMaterial; 14 | 15 | private Material m_BlurMaterial; 16 | 17 | private Material m_MiniMapMaterial; 18 | 19 | /// 20 | /// 世界空间到迷雾投影空间矩阵 21 | /// 22 | private Matrix4x4 m_WorldToProjector; 23 | 24 | private int m_BlurInteration; 25 | 26 | private bool m_GenerateMimiMapMask; 27 | 28 | private RenderTexture m_MiniMapMask; 29 | 30 | 31 | public FOWRenderer(Shader effectShader, Shader blurShader, Shader miniMapRenderShader, Vector3 position, float xSize, float zSize, Color fogColor, float blurOffset, int blurInteration) 32 | { 33 | m_EffectMaterial = new Material(effectShader); 34 | m_EffectMaterial.SetFloat("_BlurOffset", blurOffset); 35 | m_EffectMaterial.SetColor("_FogColor", fogColor); 36 | 37 | m_WorldToProjector = default(Matrix4x4); 38 | m_WorldToProjector.m00 = 1.0f/xSize; 39 | m_WorldToProjector.m03 = -1.0f/xSize*position.x + 0.5f; 40 | m_WorldToProjector.m12 = 1.0f/zSize; 41 | m_WorldToProjector.m13 = -1.0f/zSize*position.z + 0.5f; 42 | m_WorldToProjector.m33 = 1.0f; 43 | 44 | m_EffectMaterial.SetMatrix("internal_WorldToProjector", m_WorldToProjector); 45 | 46 | if (blurShader && blurInteration > 0 && blurOffset > 0) 47 | { 48 | m_BlurMaterial = new Material(blurShader); 49 | m_BlurMaterial.SetFloat("_Offset", blurOffset); 50 | } 51 | if (miniMapRenderShader) 52 | { 53 | m_MiniMapMaterial = new Material(miniMapRenderShader); 54 | m_MiniMapMaterial.SetColor("_FogColor", fogColor); 55 | } 56 | m_BlurInteration = blurInteration; 57 | } 58 | 59 | /// 60 | /// 渲染战争迷雾 61 | /// 62 | /// 63 | /// 64 | /// 65 | public void RenderFogOfWar(Camera camera, Texture2D fogTexture, RenderTexture src, RenderTexture dst) 66 | { 67 | Matrix4x4 frustumCorners = Matrix4x4.identity; 68 | 69 | float fovWHalf = camera.fieldOfView * 0.5f; 70 | 71 | Vector3 toRight = camera.transform.right * camera.nearClipPlane * Mathf.Tan(fovWHalf * Mathf.Deg2Rad) * camera.aspect; 72 | Vector3 toTop = camera.transform.up * camera.nearClipPlane * Mathf.Tan(fovWHalf * Mathf.Deg2Rad); 73 | 74 | Vector3 topLeft = (camera.transform.forward * camera.nearClipPlane - toRight + toTop); 75 | float camScale = topLeft.magnitude * camera.farClipPlane / camera.nearClipPlane; 76 | 77 | topLeft.Normalize(); 78 | topLeft *= camScale; 79 | 80 | Vector3 topRight = (camera.transform.forward * camera.nearClipPlane + toRight + toTop); 81 | topRight.Normalize(); 82 | topRight *= camScale; 83 | 84 | Vector3 bottomRight = (camera.transform.forward * camera.nearClipPlane + toRight - toTop); 85 | bottomRight.Normalize(); 86 | bottomRight *= camScale; 87 | 88 | Vector3 bottomLeft = (camera.transform.forward * camera.nearClipPlane - toRight - toTop); 89 | bottomLeft.Normalize(); 90 | bottomLeft *= camScale; 91 | 92 | frustumCorners.SetRow(0, topLeft); 93 | frustumCorners.SetRow(1, topRight); 94 | frustumCorners.SetRow(2, bottomRight); 95 | frustumCorners.SetRow(3, bottomLeft); 96 | m_EffectMaterial.SetMatrix("_FrustumCorners", frustumCorners); 97 | 98 | 99 | if (m_BlurMaterial && fogTexture) 100 | { 101 | RenderTexture rt = RenderTexture.GetTemporary(fogTexture.width, fogTexture.height, 0); 102 | Graphics.Blit(fogTexture, rt, m_BlurMaterial); 103 | for (int i = 0; i <= m_BlurInteration; i++) 104 | { 105 | RenderTexture rt2 = RenderTexture.GetTemporary(fogTexture.width / 2, fogTexture.height / 2, 0); 106 | Graphics.Blit(rt, rt2, m_BlurMaterial); 107 | RenderTexture.ReleaseTemporary(rt); 108 | rt = rt2; 109 | } 110 | if (m_MiniMapMaterial) 111 | RenderToMiniMapMask(rt); 112 | m_EffectMaterial.SetTexture("_FogTex", rt); 113 | CustomGraphicsBlit(src, dst, m_EffectMaterial); 114 | RenderTexture.ReleaseTemporary(rt); 115 | } 116 | else 117 | { 118 | if (m_MiniMapMaterial) 119 | RenderToMiniMapMask(fogTexture); 120 | m_EffectMaterial.SetTexture("_FogTex", fogTexture); 121 | CustomGraphicsBlit(src, dst, m_EffectMaterial); 122 | } 123 | // if (m_GenerateMimiMapMask) 124 | // RenderToMiniMapMask(dst); 125 | } 126 | 127 | public RenderTexture GetMimiMapMask() 128 | { 129 | return m_MiniMapMask; 130 | } 131 | 132 | /// 133 | /// 设置当前迷雾和上一次更新的迷雾的插值 134 | /// 135 | /// 136 | public void SetFogFade(float fade) 137 | { 138 | m_EffectMaterial.SetFloat("_MixValue", fade); 139 | if (m_MiniMapMaterial) 140 | m_MiniMapMaterial.SetFloat("_MixValue", fade); 141 | } 142 | 143 | public void Release() 144 | { 145 | if (m_EffectMaterial) 146 | Object.Destroy(m_EffectMaterial); 147 | if (m_BlurMaterial) 148 | Object.Destroy(m_BlurMaterial); 149 | if (m_MiniMapMask) 150 | Object.Destroy(m_MiniMapMask); 151 | if (m_MiniMapMaterial) 152 | Object.Destroy(m_MiniMapMaterial); 153 | m_MiniMapMask = null; 154 | m_EffectMaterial = null; 155 | m_BlurMaterial = null; 156 | } 157 | 158 | private void RenderToMiniMapMask(Texture from) 159 | { 160 | if (m_MiniMapMask == null) 161 | { 162 | m_MiniMapMask = new RenderTexture(512, 512, 0); 163 | } 164 | Graphics.Blit(from, m_MiniMapMask, m_MiniMapMaterial); 165 | } 166 | 167 | private static void CustomGraphicsBlit(RenderTexture source, RenderTexture dest, Material fxMaterial) 168 | { 169 | //Graphics.Blit(source, dest, fxMaterial); 170 | //return; 171 | RenderTexture.active = dest; 172 | 173 | fxMaterial.SetTexture("_MainTex", source); 174 | 175 | GL.PushMatrix(); 176 | GL.LoadOrtho(); 177 | 178 | fxMaterial.SetPass(0); 179 | 180 | GL.Begin(GL.QUADS); 181 | 182 | GL.MultiTexCoord2(0, 0.0f, 0.0f); 183 | GL.Vertex3(0.0f, 0.0f, 3.0f); // BL 184 | 185 | GL.MultiTexCoord2(0, 1.0f, 0.0f); 186 | GL.Vertex3(1.0f, 0.0f, 2.0f); // BR 187 | 188 | GL.MultiTexCoord2(0, 1.0f, 1.0f); 189 | GL.Vertex3(1.0f, 1.0f, 1.0f); // TR 190 | 191 | GL.MultiTexCoord2(0, 0.0f, 1.0f); 192 | GL.Vertex3(0.0f, 1.0f, 0.0f); // TL 193 | 194 | GL.End(); 195 | GL.PopMatrix(); 196 | } 197 | } 198 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14e35554c48b5e948898a50282ce38cc 3 | timeCreated: 1509376593 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | internal static class FOWUtils 8 | { 9 | public static void DrawFogOfWarGizmos(Vector3 position, float xSize, float zSize, int texWidth, int texHeight, 10 | float heightRange) 11 | { 12 | if (heightRange <= 0) 13 | return; 14 | if (xSize <= 0 || zSize <= 0 || texWidth <= 0 || texHeight <= 0) 15 | return; 16 | Gizmos.color = Color.green; 17 | 18 | float deltax = xSize / texWidth; 19 | float deltay = zSize / texHeight; 20 | 21 | Vector3 origin = position - new Vector3(xSize / 2, 0, zSize / 2); 22 | 23 | for (int i = 0; i <= texWidth; i++) 24 | { 25 | Vector3 b = origin + new Vector3(i * deltax, 0, 0); 26 | Vector3 t = origin + new Vector3(i * deltax, 0, zSize); 27 | Gizmos.DrawLine(b, t); 28 | } 29 | for (int j = 0; j <= texHeight; j++) 30 | { 31 | Vector3 b = origin + new Vector3(0, 0, j * deltay); 32 | Vector3 t = origin + new Vector3(xSize, 0, j * deltay); 33 | Gizmos.DrawLine(b, t); 34 | } 35 | 36 | Gizmos.color = Color.blue; 37 | 38 | Gizmos.DrawWireCube(position+Vector3.up*heightRange/2, new Vector3(xSize, heightRange, zSize)); 39 | } 40 | 41 | public static bool IsObstacle(float beginx, float beginy, float deltax, float deltay, float heightRange, int x, int y) 42 | { 43 | float px = beginx + x*deltax + deltax*0.5f; 44 | float py = beginy + y*deltay + deltay*0.5f; 45 | Ray ray = new Ray(new Vector3(px, beginy + heightRange, py), Vector3.down); 46 | if (Physics.Raycast(ray, heightRange)) 47 | { 48 | return true; 49 | } 50 | return false; 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/FOWUtils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab5f70b62b757fa4f8a875320424e736 3 | timeCreated: 1509376354 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92217d0ccee1d2e40bdb26b8ea2a0630 3 | folderAsset: yes 4 | timeCreated: 1515841604 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/CircularMask.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | 7 | namespace ASL.FogOfWar 8 | { 9 | internal class CircularMask : MaskCalcluatorBase 10 | { 11 | protected override void RealtimeCalculate(FOWFieldData field, FOWMap map) 12 | { 13 | Vector3 worldPosition = field.position; 14 | int rx = (int) (field.radius*map.invDeltaX); 15 | int rz = (int) (field.radius*map.invDeltaZ); 16 | int rs = rx*rx; 17 | int x = Mathf.FloorToInt((worldPosition.x - map.beginPosition.x) * map.invDeltaX); 18 | int z = Mathf.FloorToInt((worldPosition.z - map.beginPosition.z) * map.invDeltaZ); 19 | 20 | int beginx = Mathf.Max(0, x - rx); 21 | int beginy = Mathf.Max(0, z - rz); 22 | int endx = Mathf.Min(map.texWidth, x + rx); 23 | int endy = Mathf.Min(map.texHeight, z + rz); 24 | 25 | for (int i = beginx; i < endx; i++) 26 | { 27 | for (int j = beginy; j < endy; j++) 28 | { 29 | int dx = i - x; 30 | int dy = j - z; 31 | int rads = dx * dx + dy * dy; 32 | if (rads <= rs) 33 | map.maskTexture.SetAsVisible(i, j); 34 | } 35 | } 36 | } 37 | 38 | public override void Release() 39 | { 40 | 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/CircularMask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 523ee3f4f988f484c90c6d8d23ee26c4 3 | timeCreated: 1515847309 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVAccurate.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace ASL.FogOfWar 5 | { 6 | /// 7 | /// 精确FOV计算器算法2 8 | /// 9 | internal class FOVAccurate : FOVCalculator 10 | { 11 | 12 | public FOVAccurate() : base() 13 | { 14 | } 15 | 16 | protected override void RayCast(FOWMap map, FOWMapPos pos, int centX, int centZ, FOWFieldData field) 17 | { 18 | int x = pos.x - centX; 19 | int z = pos.y - centZ; 20 | 21 | float corner1x, corner1z, corner2x, corner2z; 22 | GetCornersPos(x, z, out corner1x, out corner1z, out corner2x, out corner2z); 23 | RaycastLine(map, pos, centX, centZ, corner1x, corner1z, field); 24 | RaycastLine(map, pos, centX, centZ, corner2x, corner2z, field); 25 | 26 | } 27 | 28 | private void GetCornersPos(int x, int z, out float corner1x, out float corner1z, out float corner2x, out float corner2z) 29 | { 30 | corner1x = 0; 31 | corner1z = 0; 32 | corner2x = 0; 33 | corner2z = 0; 34 | if (x == 0 && z != 0) 35 | { 36 | corner1x = -0.5f; 37 | corner2x = 0.5f; 38 | if (z >= 0) 39 | { 40 | corner1z = z - 0.5f; 41 | corner2z = z - 0.5f; 42 | } 43 | else 44 | { 45 | corner1z = z + 0.5f; 46 | corner2z = z + 0.5f; 47 | } 48 | } 49 | else if (x != 0 && z == 0) 50 | { 51 | corner1z = -0.5f; 52 | corner2z = 0.5f; 53 | if (x >= 0) 54 | { 55 | corner1x = x - 0.5f; 56 | corner2x = x - 0.5f; 57 | } 58 | else 59 | { 60 | corner1x = x + 0.5f; 61 | corner2x = x + 0.5f; 62 | } 63 | } 64 | else if ((x < 0 && z < 0) || (x > 0 && z > 0)) 65 | { 66 | corner1x = x - 0.5f; 67 | corner1z = z + 0.5f; 68 | corner2x = x + 0.5f; 69 | corner2z = z - 0.5f; 70 | } 71 | else if ((x < 0 && z > 0) || (x > 0 && z < 0)) 72 | { 73 | corner1x = x - 0.5f; 74 | corner1z = z - 0.5f; 75 | corner2x = x + 0.5f; 76 | corner2z = z + 0.5f; 77 | } 78 | } 79 | 80 | private void RaycastLine(FOWMap map, FOWMapPos pos, int centX, int centZ, float px, float pz, FOWFieldData field) 81 | { 82 | Vector2 dir = new Vector2(px, pz)*10; 83 | int x = centX + (int)dir.x; 84 | int y = centZ + (int)dir.y; 85 | 86 | SetInvisibleLine(map, pos.x, pos.y, x, y, centX, centZ, field.radiusSquare); 87 | } 88 | 89 | } 90 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVAccurate.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f24574a7b48af8543a7eaa0f59f9bcd5 3 | timeCreated: 1517500349 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVCalculator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | /// 8 | /// FOV蒙版计算器 9 | /// 10 | internal abstract class FOVCalculator : MaskCalcluatorBase 11 | { 12 | protected Queue m_Queue; 13 | 14 | protected List m_Arrives; 15 | 16 | public FOVCalculator() 17 | { 18 | m_Queue = new Queue(); 19 | m_Arrives = new List(); 20 | } 21 | 22 | protected sealed override void RealtimeCalculate(FOWFieldData field, FOWMap map) 23 | { 24 | Vector3 worldPosition = field.position; 25 | float radiusSq = field.radiusSquare; 26 | 27 | int x = Mathf.FloorToInt((worldPosition.x - map.beginPosition.x) * map.invDeltaX); 28 | int z = Mathf.FloorToInt((worldPosition.z - map.beginPosition.z) * map.invDeltaZ); 29 | 30 | if (x < 0 || x >= map.texWidth) 31 | return; 32 | if (z < 0 || z >= map.texHeight) 33 | return; 34 | if (map.mapData[x, z]) 35 | { 36 | return; 37 | } 38 | m_Queue.Clear(); 39 | m_Arrives.Clear(); 40 | 41 | m_Queue.Enqueue(new FOWMapPos(x, z)); 42 | m_Arrives.Add(z * map.texWidth + x); 43 | map.maskTexture.SetAsVisible(x, z); 44 | 45 | while (m_Queue.Count > 0) 46 | { 47 | var root = m_Queue.Dequeue(); 48 | if (map.mapData[root.x, root.y]) 49 | { 50 | if (PreRayCast(map, root, x, z)) 51 | { 52 | int index = root.y*map.texWidth + root.x; 53 | if (!m_Arrives.Contains(index)) 54 | m_Arrives.Add(index); 55 | map.maskTexture.SetAsVisible(root.x, root.y); 56 | } 57 | else 58 | RayCast(map, root, x, z, field); 59 | continue; 60 | } 61 | SetVisibleAtPosition(map, root.x - 1, root.y, x, z, radiusSq); 62 | SetVisibleAtPosition(map, root.x, root.y - 1, x, z, radiusSq); 63 | SetVisibleAtPosition(map, root.x + 1, root.y, x, z, radiusSq); 64 | SetVisibleAtPosition(map, root.x, root.y + 1, x, z, radiusSq); 65 | } 66 | } 67 | 68 | public override void Release() 69 | { 70 | m_Queue.Clear(); 71 | m_Queue = null; 72 | m_Arrives.Clear(); 73 | m_Arrives = null; 74 | } 75 | 76 | private bool PreRayCast(FOWMap map, FOWMapPos pos, int centX, int centZ) 77 | { 78 | float k = ((float) (pos.y - centZ))/(pos.x - centX); 79 | if (k < -0.414f && k >= -2.414f) 80 | { 81 | return !IsVisible(map, pos.x + 1, pos.y + 1) && !IsVisible(map, pos.x - 1, pos.y - 1); 82 | }else if (k < -2.414f || k >= 2.414f) 83 | { 84 | return !IsVisible(map, pos.x + 1, pos.y) && !IsVisible(map, pos.x - 1, pos.y); 85 | }else if (k < 2.414f && k >= 0.414f) 86 | { 87 | return !IsVisible(map, pos.x + 1, pos.y - 1) && !IsVisible(map, pos.x - 1, pos.y + 1); 88 | } 89 | else 90 | { 91 | return !IsVisible(map, pos.x, pos.y + 1) && !IsVisible(map, pos.x, pos.y - 1); 92 | } 93 | } 94 | 95 | private bool IsVisible(FOWMap map, int x, int y) 96 | { 97 | if (x < 0 || x >= map.texWidth) 98 | return false; 99 | if (y < 0 || y >= map.texHeight) 100 | return false; 101 | return !map.mapData[x, y]; 102 | } 103 | 104 | protected abstract void RayCast(FOWMap map, FOWMapPos pos, int centX, int centZ, 105 | FOWFieldData field); 106 | 107 | private void SetVisibleAtPosition(FOWMap map, int x, int z, int centX, int centZ, float radiusSq) 108 | { 109 | if (x < 0 || z < 0 || x >= map.texWidth || z >= map.texHeight) 110 | return; 111 | if (!IsInRange(map, x, z, centX, centZ, radiusSq)) 112 | return; 113 | int index = z * map.texWidth + x; 114 | if (m_Arrives.Contains(index)) 115 | return; 116 | m_Arrives.Add(index); 117 | m_Queue.Enqueue(new FOWMapPos(x, z)); 118 | map.maskTexture.SetAsVisible(x, z); 119 | } 120 | 121 | protected void SetInvisibleLine(FOWMap map, int beginx, int beginy, int endx, int endy, int centX, int centZ, float rsq) 122 | { 123 | int dx = Mathf.Abs(endx - beginx); 124 | int dy = Mathf.Abs(endy - beginy); 125 | //int x, y; 126 | int step = ((endy < beginy && endx >= beginx) || (endy >= beginy && endx < beginx)) ? -1 : 1; 127 | int p, twod, twodm; 128 | int pv1, pv2, to; 129 | int x, y; 130 | if (dy < dx) 131 | { 132 | p = 2 * dy - dx; 133 | twod = 2 * dy; 134 | twodm = 2 * (dy - dx); 135 | if (beginx > endx) 136 | { 137 | pv1 = endx; 138 | pv2 = endy; 139 | endx = beginx; 140 | } 141 | else 142 | { 143 | pv1 = beginx; 144 | pv2 = beginy; 145 | } 146 | to = endx; 147 | } 148 | else 149 | { 150 | p = 2 * dx - dy; 151 | twod = 2 * dx; 152 | twodm = 2 * (dx - dy); 153 | if (beginy > endy) 154 | { 155 | pv2 = endx; 156 | pv1 = endy; 157 | endy = beginy; 158 | } 159 | else 160 | { 161 | pv2 = beginx; 162 | pv1 = beginy; 163 | } 164 | to = endy; 165 | } 166 | if (dy < dx) 167 | { 168 | x = pv1; 169 | y = pv2; 170 | } 171 | else 172 | { 173 | x = pv2; 174 | y = pv1; 175 | } 176 | SetInvisibleAtPosition(map, x, y); 177 | while (pv1 < to) 178 | { 179 | pv1++; 180 | if (p < 0) 181 | p += twod; 182 | else 183 | { 184 | pv2 += step; 185 | p += twodm; 186 | } 187 | 188 | if (dy < dx) 189 | { 190 | x = pv1; 191 | y = pv2; 192 | } 193 | else 194 | { 195 | x = pv2; 196 | y = pv1; 197 | } 198 | if (!IsInRange(map, x, y, centX, centZ, rsq)) 199 | { 200 | return; 201 | } 202 | SetInvisibleAtPosition(map, x, y); 203 | } 204 | 205 | } 206 | 207 | private bool IsInRange(FOWMap map, int x, int z, int centX, int centZ, float radiusSq) 208 | { 209 | float r = (x - centX) * (x - centX) * map.deltaX * map.deltaX + (z - centZ) * (z - centZ) * map.deltaZ * map.deltaZ; 210 | if (r > radiusSq) 211 | return false; 212 | return true; 213 | } 214 | 215 | private void SetInvisibleAtPosition(FOWMap map, int x, int z) 216 | { 217 | int index = z * map.texWidth + x; 218 | if (m_Arrives.Contains(index) == false) 219 | { 220 | m_Arrives.Add(index); 221 | } 222 | } 223 | } 224 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVCalculator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45d31b910cd0eb04681d3864171fc750 3 | timeCreated: 1515843918 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVSimple.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | internal class FOVSimple : FOVCalculator 8 | { 9 | protected override void RayCast(FOWMap map, FOWMapPos pos, int centX, int centZ, FOWFieldData field) 10 | { 11 | float r = field.radius*map.invDeltaX; 12 | Vector2 dir = new Vector2(pos.x - centX, pos.y - centZ); 13 | float l = dir.magnitude; 14 | if (r - l <= 0) 15 | return; 16 | dir = dir.normalized * (r - l); 17 | int x = pos.x + (int)dir.x; 18 | int y = pos.y + (int)dir.y; 19 | 20 | SetInvisibleLine(map, pos.x, pos.y, x, y, centX, centZ, field.radiusSquare); 21 | } 22 | 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/FOVSimple.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2524a3d77fad95f4ab18235a846f71ba 3 | timeCreated: 1515841604 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/MaskCalcluatorBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace ASL.FogOfWar 6 | { 7 | /// 8 | /// 战争迷雾蒙版计算器基类-将蒙版计算抽象出来,方便替换算法 9 | /// 10 | internal abstract class MaskCalcluatorBase 11 | { 12 | 13 | public void Calculate(FOWFieldData field, FOWMap map) 14 | { 15 | if (map.mapData.isPregeneration) 16 | { 17 | UsePregenerationDataCalculate(field, map); 18 | } 19 | else 20 | { 21 | RealtimeCalculate(field, map); 22 | } 23 | } 24 | 25 | /// 26 | /// 实时计算 27 | /// 28 | /// 29 | /// 30 | protected abstract void RealtimeCalculate(FOWFieldData field, FOWMap map); 31 | 32 | /// 33 | /// TODO:使用预生成FOV数据计算(暂未实现) 34 | /// 35 | /// 36 | /// 37 | private void UsePregenerationDataCalculate(FOWFieldData field, FOWMap map) 38 | { 39 | 40 | } 41 | 42 | public abstract void Release(); 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/Core/MaskCalcluater/MaskCalcluatorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5637ccafe4317444bb3605ec922af45f 3 | timeCreated: 1515841604 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using ASL.FogOfWar; 4 | using UnityEngine; 5 | 6 | public struct FOWMapPos 7 | { 8 | public int x; 9 | public int y; 10 | 11 | public FOWMapPos(int x, int y) 12 | { 13 | this.x = x; 14 | this.y = y; 15 | } 16 | } 17 | 18 | /// 19 | /// 屏幕空间战争迷雾 20 | /// 21 | public class FogOfWarEffect : MonoBehaviour { 22 | 23 | public enum FogMaskType 24 | { 25 | /// 26 | /// 精确计算的FOV 27 | /// 28 | AccurateFOV, 29 | /// 30 | /// 基础FOV 31 | /// 32 | BasicFOV, 33 | /// 34 | /// 简单圆形 35 | /// 36 | Circular, 37 | } 38 | 39 | public static FogOfWarEffect Instance 40 | { 41 | get 42 | { 43 | if (instance == null) 44 | instance = FindObjectOfType(); 45 | return instance; 46 | } 47 | } 48 | 49 | private static FogOfWarEffect instance; 50 | 51 | /// 52 | /// 迷雾蒙版类型 53 | /// 54 | public FogMaskType fogMaskType { get { return m_FogMaskType; } } 55 | /// 56 | /// 战争迷雾颜色(RGB迷雾颜色,Alpha已探索区域透明度) 57 | /// 58 | public Color fogColor { get { return m_FogColor; } } 59 | /// 60 | /// 迷雾区域宽度 61 | /// 62 | public float xSize { get { return m_XSize; } } 63 | /// 64 | /// 迷雾区域高度 65 | /// 66 | public float zSize { get { return m_ZSize; } } 67 | /// 68 | /// 迷雾贴图宽度 69 | /// 70 | public int texWidth { get { return m_TexWidth; } } 71 | /// 72 | /// 迷雾贴图高度 73 | /// 74 | public int texHeight { get { return m_TexHeight; } } 75 | /// 76 | /// 迷雾区域中心坐标 77 | /// 78 | public Vector3 centerPosition { get { return m_CenterPosition; } } 79 | 80 | public float heightRange { get { return m_HeightRange; } } 81 | 82 | public Texture2D fowMaskTexture 83 | { 84 | get 85 | { 86 | if (m_Map != null) 87 | return m_Map.GetFOWTexture(); 88 | return null; 89 | } 90 | } 91 | 92 | public RenderTexture minimapMask 93 | { 94 | get 95 | { 96 | if (!m_GenerateMinimapMask) 97 | return null; 98 | return m_Renderer.GetMimiMapMask(); 99 | } 100 | } 101 | 102 | [SerializeField] 103 | private FogMaskType m_FogMaskType; 104 | [SerializeField] 105 | private Color m_FogColor = Color.black; 106 | [SerializeField] 107 | private float m_XSize; 108 | [SerializeField] 109 | private float m_ZSize; 110 | [SerializeField] 111 | private int m_TexWidth; 112 | [SerializeField] 113 | private int m_TexHeight; 114 | [SerializeField] 115 | private Vector3 m_CenterPosition; 116 | [SerializeField] 117 | private float m_HeightRange; 118 | /// 119 | /// 模糊偏移量 120 | /// 121 | [SerializeField] 122 | private float m_BlurOffset; 123 | /// 124 | /// 模糊迭代次数 125 | /// 126 | [SerializeField] 127 | private int m_BlurInteration; 128 | /// 129 | /// 是否生成小地图蒙版 130 | /// 131 | private bool m_GenerateMinimapMask; 132 | 133 | /// 134 | /// 迷雾特效shader 135 | /// 136 | public Shader effectShader; 137 | /// 138 | /// 模糊shader 139 | /// 140 | public Shader blurShader; 141 | /// 142 | /// 小地图蒙版渲染shader 143 | /// 144 | public Shader minimapRenderShader; 145 | 146 | 147 | 148 | /// 149 | /// 预生成的地图FOV数据(如果为空则使用实时计算FOV) 150 | /// 151 | //public FOWPregenerationFOVMapData pregenerationFOVMapData; 152 | 153 | /// 154 | /// 战争迷雾地图对象 155 | /// 156 | private FOWMap m_Map; 157 | /// 158 | /// 战争迷雾渲染器 159 | /// 160 | private FOWRenderer m_Renderer; 161 | 162 | private bool m_IsInitialized; 163 | 164 | private float m_MixTime = 0.0f; 165 | private float m_RefreshTime = 0.0f; 166 | 167 | private float m_DeltaX; 168 | private float m_DeltaZ; 169 | private float m_InvDeltaX; 170 | private float m_InvDeltaZ; 171 | 172 | private Camera m_Camera; 173 | 174 | private const float kDispearSpeed = 3f; 175 | private const float kRefreshTextureSpeed = 4.0f; 176 | 177 | private Vector3 m_BeginPos; 178 | 179 | private List m_FieldDatas; 180 | 181 | private bool m_IsFieldDatasUpdated; 182 | 183 | void Awake() 184 | { 185 | m_IsInitialized = Init(); 186 | 187 | } 188 | 189 | void OnDestroy() 190 | { 191 | if (m_Renderer != null) 192 | m_Renderer.Release(); 193 | if (m_Map != null) 194 | m_Map.Release(); 195 | if (m_FieldDatas != null) 196 | m_FieldDatas.Clear(); 197 | m_FieldDatas = null; 198 | m_Renderer = null; 199 | m_Map = null; 200 | instance = null; 201 | } 202 | 203 | void FixedUpdate() 204 | { 205 | /* 206 | 更新迷雾纹理 207 | */ 208 | if (m_MixTime >= 1.0f) 209 | { 210 | if (m_RefreshTime >= 1.0f) 211 | { 212 | m_RefreshTime = 0.0f; 213 | if (m_Map.RefreshFOWTexture()) 214 | { 215 | 216 | m_Renderer.SetFogFade(0); 217 | m_MixTime = 0; 218 | m_IsFieldDatasUpdated = false; 219 | //m_Renderer.SetFogTexture(m_Map.GetFOWTexture()); 220 | } 221 | } 222 | else 223 | { 224 | m_RefreshTime += Time.deltaTime* kRefreshTextureSpeed; 225 | } 226 | } 227 | else 228 | { 229 | m_MixTime += Time.deltaTime* kDispearSpeed; 230 | m_Renderer.SetFogFade(m_MixTime); 231 | } 232 | } 233 | 234 | private bool Init() 235 | { 236 | if (m_XSize <= 0 || m_ZSize <= 0 || m_TexWidth <= 0 || m_TexHeight <= 0) 237 | return false; 238 | if (effectShader == null || !effectShader.isSupported) 239 | return false; 240 | m_Camera = gameObject.GetComponent(); 241 | if (m_Camera == null) 242 | return false; 243 | m_Camera.depthTextureMode |= DepthTextureMode.Depth; 244 | m_DeltaX = m_XSize / m_TexWidth; 245 | m_DeltaZ = m_ZSize / m_TexHeight; 246 | m_InvDeltaX = 1.0f/m_DeltaX; 247 | m_InvDeltaZ = 1.0f/m_DeltaZ; 248 | m_BeginPos = m_CenterPosition - new Vector3(m_XSize * 0.5f, 0, m_ZSize * 0.5f); 249 | m_Renderer = new FOWRenderer(effectShader, blurShader, minimapRenderShader, m_CenterPosition, m_XSize, m_ZSize, m_FogColor, m_BlurOffset, m_BlurInteration); 250 | m_Map = new FOWMap(m_FogMaskType, m_BeginPos, m_XSize, m_ZSize, m_TexWidth, m_TexHeight, m_HeightRange); 251 | IFOWMapData md = gameObject.GetComponent(); 252 | if (md != null) 253 | m_Map.SetMapData(md); 254 | else 255 | { 256 | m_Map.SetMapData(new FOWMapData(m_TexHeight, m_TexHeight)); 257 | m_Map.GenerateMapData(m_HeightRange); 258 | } 259 | if (minimapRenderShader != null) 260 | m_GenerateMinimapMask = true; 261 | return true; 262 | } 263 | 264 | /// 265 | /// 世界坐标转战争迷雾坐标 266 | /// 267 | /// 268 | /// 269 | public static FOWMapPos WorldPositionToFOW(Vector3 position) 270 | { 271 | if (!Instance) 272 | return default(FOWMapPos); 273 | if (!Instance.m_IsInitialized) 274 | return default(FOWMapPos); 275 | 276 | int x = Mathf.FloorToInt((position.x - Instance.m_BeginPos.x) * Instance.m_InvDeltaX); 277 | int z = Mathf.FloorToInt((position.z - Instance.m_BeginPos.z) * Instance.m_InvDeltaZ); 278 | 279 | return new FOWMapPos(x, z); 280 | } 281 | 282 | public static Vector2 WorldPositionTo2DLocal(Vector3 position) 283 | { 284 | if (!Instance) 285 | return default(Vector2); 286 | if (!Instance.m_IsInitialized) 287 | return default(Vector2); 288 | 289 | Vector2 pos = default(Vector2); 290 | pos.x = (position.x - Instance.m_BeginPos.x)/Instance.m_XSize; 291 | pos.y = (position.z - Instance.m_BeginPos.z)/Instance.m_ZSize; 292 | 293 | return pos; 294 | } 295 | 296 | ///// 297 | ///// 将指定位置设置为可见 298 | ///// 299 | ///// 视野 300 | //public static void SetVisibleAtPosition(FOWFieldData fieldData) 301 | //{ 302 | // if (!Instance) 303 | // return; 304 | // if (!Instance.m_IsInitialized) 305 | // return; 306 | // if (fieldData == null) 307 | // return; 308 | 309 | // Instance.m_Map.SetVisible(fieldData); 310 | 311 | //} 312 | 313 | public static void UpdateFOWFieldData(FOWFieldData data) 314 | { 315 | if (!Instance) 316 | return; 317 | if (!Instance.m_IsInitialized) 318 | return; 319 | if (Instance.m_FieldDatas == null) 320 | Instance.m_FieldDatas = new List(); 321 | if (!Instance.m_FieldDatas.Contains(data)) 322 | { 323 | Instance.m_FieldDatas.Add(data); 324 | } 325 | if (!Instance.m_IsFieldDatasUpdated) 326 | { 327 | //lock (Instance.m_FieldDatas) 328 | { 329 | Instance.m_Map.SetVisible(Instance.m_FieldDatas); 330 | Instance.m_IsFieldDatasUpdated = true; 331 | } 332 | } 333 | } 334 | 335 | public static void ReleaseFOWFieldData(FOWFieldData data) 336 | { 337 | if (!instance) 338 | return; 339 | if (!instance.m_IsInitialized) 340 | return; 341 | //lock (instance.m_FieldDatas) 342 | { 343 | if (instance.m_FieldDatas != null && instance.m_FieldDatas.Contains(data)) 344 | instance.m_FieldDatas.Remove(data); 345 | } 346 | } 347 | 348 | /// 349 | /// 是否在地图中可见 350 | /// 351 | /// 352 | /// 353 | public static bool IsVisibleInMap(Vector3 position) 354 | { 355 | if (!Instance) 356 | return true; 357 | if (!Instance.m_IsInitialized) 358 | return true; 359 | int x = Mathf.FloorToInt((position.x - Instance.m_BeginPos.x)* Instance.m_InvDeltaX); 360 | int z = Mathf.FloorToInt((position.z - Instance.m_BeginPos.z)* Instance.m_InvDeltaZ); 361 | 362 | return Instance.m_Map.IsVisibleInMap(x, z); 363 | 364 | } 365 | 366 | void OnRenderImage(RenderTexture src, RenderTexture dst) 367 | { 368 | if (!m_IsInitialized) 369 | Graphics.Blit(src, dst); 370 | else 371 | { 372 | m_Renderer.RenderFogOfWar(m_Camera, m_Map.GetFOWTexture(), src, dst); 373 | } 374 | } 375 | 376 | void OnDrawGizmosSelected() 377 | { 378 | FOWUtils.DrawFogOfWarGizmos(m_CenterPosition, m_XSize, m_ZSize, m_TexWidth, m_TexHeight, m_HeightRange); 379 | } 380 | } 381 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarEffect.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d74b28aa2932c6c4188a8f9749aaf8a1 3 | timeCreated: 1509376310 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarExplorer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// 视野数据-由于计算fov是在子线程操作,通过将视野数据以object类型参数传入,使用简单数据类型或结构体会产生装箱操作,因此将视野封装成类 7 | /// 8 | public class FOWFieldData 9 | { 10 | public float radiusSquare; 11 | public Vector3 position; 12 | public float radius; 13 | 14 | public FOWFieldData(Vector3 position, float radius) 15 | { 16 | this.position = position; 17 | this.radius = radius; 18 | this.radiusSquare = radius*radius; 19 | } 20 | } 21 | 22 | /// 23 | /// 探索者 24 | /// 25 | public class FogOfWarExplorer : MonoBehaviour 26 | { 27 | /// 28 | /// 视野半径 29 | /// 30 | public float radius; 31 | 32 | private Vector3 m_OriginPosition; 33 | 34 | private FOWMapPos m_FowMapPos; 35 | 36 | private FOWFieldData m_FieldData; 37 | 38 | private bool m_IsInitialized; 39 | 40 | void Start() 41 | { 42 | m_FieldData = new FOWFieldData(transform.position, radius); 43 | } 44 | 45 | void Update () 46 | { 47 | if (radius <= 0) 48 | return; 49 | if (m_OriginPosition != transform.position) 50 | { 51 | m_OriginPosition = transform.position; 52 | var pos = FogOfWarEffect.WorldPositionToFOW(transform.position); 53 | if (m_FowMapPos.x != pos.x || m_FowMapPos.y != pos.y || !m_IsInitialized) 54 | { 55 | m_FowMapPos = pos; 56 | m_IsInitialized = true; 57 | m_FieldData.position = transform.position; 58 | m_FieldData.radius = radius; 59 | //FogOfWarEffect.SetVisibleAtPosition(m_FieldData); 60 | FogOfWarEffect.UpdateFOWFieldData(m_FieldData); 61 | } 62 | } 63 | } 64 | 65 | void OnDestroy() 66 | { 67 | if (m_FieldData != null) 68 | FogOfWarEffect.ReleaseFOWFieldData(m_FieldData); 69 | m_FieldData = null; 70 | } 71 | 72 | void OnDrawGizmosSelected() 73 | { 74 | Gizmos.color = Color.blue; 75 | Gizmos.DrawWireSphere(transform.position, radius); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarExplorer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b31d3676dd904d34da860071d329d5b2 3 | timeCreated: 1509376562 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarStalker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// 潜行者 7 | /// 8 | public class FogOfWarStalker : MonoBehaviour 9 | { 10 | 11 | private float m_RequestTime; 12 | 13 | private bool m_Visible = true; 14 | 15 | void FixedUpdate() 16 | { 17 | m_RequestTime += Time.deltaTime; 18 | if (m_RequestTime > 0.3f) 19 | { 20 | m_RequestTime = 0; 21 | bool visible = FogOfWarEffect.IsVisibleInMap(transform.position); 22 | SetVisible(visible); 23 | } 24 | } 25 | 26 | void SetVisible(bool visible) 27 | { 28 | if (m_Visible != visible) 29 | { 30 | m_Visible = visible; 31 | for (int i = 0; i < transform.childCount; i++) 32 | { 33 | transform.GetChild(i).gameObject.SetActive(visible); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/FogOfWar/FogOfWarStalker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6263593ef72466341bc1f47c9491ff03 3 | timeCreated: 1509376342 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56ac367c24002b84395dedf075b7df7a 3 | folderAsset: yes 4 | timeCreated: 1509728418 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestAI.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.AI; 4 | 5 | public class TestAI : MonoBehaviour 6 | { 7 | public delegate Vector3 RefreshTargetDelegate(); 8 | 9 | public RefreshTargetDelegate onRefreshTarget; 10 | 11 | private Vector3 m_TargetPoint; 12 | 13 | private NavMeshAgent m_Agent; 14 | 15 | private float m_CurrentTime; 16 | 17 | private float m_WaitingTime; 18 | 19 | 20 | void Start() 21 | { 22 | m_Agent = gameObject.GetComponent(); 23 | 24 | m_WaitingTime = Random.Range(1.0f, 5.0f); 25 | } 26 | 27 | void FixedUpdate() 28 | { 29 | m_CurrentTime += Time.deltaTime; 30 | if (m_CurrentTime > m_WaitingTime) 31 | { 32 | m_CurrentTime = 0; 33 | m_WaitingTime = Random.Range(4f, 40f); 34 | m_TargetPoint = onRefreshTarget(); 35 | m_Agent.SetDestination(m_TargetPoint); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestAI.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1932ce1ec0019394884829a1a38bd628 3 | timeCreated: 1509731269 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class TestController : MonoBehaviour 6 | { 7 | [System.Serializable] 8 | public class Outpost 9 | { 10 | public Transform transform; 11 | public float radius; 12 | } 13 | 14 | public Outpost[] outposts; 15 | 16 | public TestAI[] ais; 17 | 18 | void Start () { 19 | foreach (var ai in ais) 20 | { 21 | if (ai != null) 22 | ai.onRefreshTarget = GetRandomPosition; 23 | } 24 | } 25 | 26 | private Vector3 GetRandomPosition() 27 | { 28 | int outpostIndex = Random.Range(0, outposts.Length); 29 | var op = outposts[outpostIndex]; 30 | float ang = Random.Range(0, 360f)*Mathf.Deg2Rad; 31 | float rad = Random.Range(0, op.radius); 32 | 33 | float x = Mathf.Cos(ang) * rad; 34 | float z = Mathf.Sin(ang) * rad; 35 | return op.transform.position + new Vector3(x, 0, z); 36 | } 37 | 38 | void OnDrawGizmos() 39 | { 40 | Gizmos.color = Color.blue; 41 | if (outposts != null && outposts.Length > 0) 42 | { 43 | for (int i = 0; i < outposts.Length; i++) 44 | { 45 | if (outposts[i] != null && outposts[i].transform != null) 46 | Gizmos.DrawWireSphere(outposts[i].transform.position, outposts[i].radius); 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a690b72ce9101f44901071d088a1ea0 3 | timeCreated: 1509728435 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestMiniMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class TestMiniMap : MonoBehaviour 7 | { 8 | 9 | public Image mask; 10 | public Image map; 11 | public RawImage maskImage; 12 | public Transform player; 13 | 14 | //private Material minimapMat; 15 | 16 | //private Texture2D maskTexture; 17 | 18 | void Start () 19 | { 20 | //if (map != null) 21 | //{ 22 | // minimapMat = new Material(Shader.Find("UI/FogOfWar/MinimapMask")); 23 | // map.material = minimapMat; 24 | // map.material.SetColor("_FogColor", FogOfWarEffect.Instance.fogColor); 25 | 26 | //} 27 | } 28 | 29 | void Update () { 30 | if (player != null) 31 | { 32 | if (maskImage.texture == null) 33 | { 34 | maskImage.texture = FogOfWarEffect.Instance.minimapMask; 35 | 36 | } 37 | // //if (maskTexture == null) 38 | // { 39 | // maskTexture = FogOfWarEffect.Instance.fowMaskTexture; 40 | // map.material.SetTexture("_MiniMap", maskTexture); 41 | // } 42 | Vector2 p = FogOfWarEffect.WorldPositionTo2DLocal(player.position); 43 | p.x = -p.x*map.rectTransform.rect.width; 44 | p.y = -p.y*map.rectTransform.rect.height; 45 | 46 | map.rectTransform.anchoredPosition = p; 47 | } 48 | } 49 | 50 | void OnGUI() 51 | { 52 | GUI.color = Color.red; 53 | GUILayout.Label(map.rectTransform.anchoredPosition.ToString("f4")); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestMiniMap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f9736add7c7e024785d7639f776c572 3 | timeCreated: 1523888617 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestPlayer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.AI; 5 | 6 | public class TestPlayer : MonoBehaviour 7 | { 8 | public float distance; 9 | public float angle = 45; 10 | 11 | private Vector3 m_CameraPosition; 12 | 13 | private NavMeshAgent m_Agent; 14 | 15 | void Start () 16 | { 17 | m_Agent = gameObject.GetComponent(); 18 | Camera.main.transform.rotation = Quaternion.Euler(angle, 0, 0); 19 | Camera.main.transform.position = transform.position - Camera.main.transform.forward*distance; 20 | } 21 | 22 | void Update () { 23 | m_CameraPosition = transform.position - Camera.main.transform.forward * distance; 24 | Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, m_CameraPosition, Time.deltaTime*3f); 25 | 26 | if (Input.GetMouseButtonDown(0)) 27 | { 28 | Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); 29 | RaycastHit hit; 30 | if (Physics.Raycast(ray, out hit)) 31 | { 32 | m_Agent.SetDestination(hit.point); 33 | 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/Test/TestPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fcfc5dbb8b6a184c8eb1d7d17c46dfc 3 | timeCreated: 1509731576 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 794f491d8c539a5418e2d18b70c2fd8c 3 | folderAsset: yes 4 | timeCreated: 1509549564 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarBlur.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/FogOfWarBlur" { 2 | Properties { 3 | _MainTex ("Base (RGB)", 2D) = "white" {} 4 | _Offset ("Offset", float) = 0 5 | } 6 | SubShader { 7 | Pass { 8 | CGPROGRAM 9 | #pragma vertex vert_img 10 | #pragma fragment frag 11 | #include "UnityCG.cginc" 12 | 13 | sampler2D _MainTex; 14 | float _Offset; 15 | 16 | fixed4 frag(v2f_img i):COLOR{ 17 | float4 uv01 = i.uv.xyxy + _Offset * float4(0, 1, 0, -1); 18 | float4 uv10 = i.uv.xyxy + _Offset * float4(1, 0, -1, 0); 19 | float4 uv23 = i.uv.xyxy + _Offset * float4(0, 1, 0, -1) * 2.0; 20 | float4 uv32 = i.uv.xyxy + _Offset * float4(1, 0, -1, 0) * 2.0; 21 | float4 uv45 = i.uv.xyxy + _Offset * float4(0, 1, 0, -1) * 3.0; 22 | float4 uv54 = i.uv.xyxy + _Offset * float4(1, 0, -1, 0) * 3.0; 23 | 24 | fixed4 c = fixed4(0, 0, 0, 0); 25 | c += 0.4 * tex2D(_MainTex, i.uv); 26 | c += 0.075 * tex2D(_MainTex, uv01.xy); 27 | c += 0.075 * tex2D(_MainTex, uv01.zw); 28 | c += 0.075 * tex2D(_MainTex, uv10.xy); 29 | c += 0.075 * tex2D(_MainTex, uv10.zw); 30 | c += 0.05 * tex2D(_MainTex, uv23.xy); 31 | c += 0.05 * tex2D(_MainTex, uv23.zw); 32 | c += 0.05 * tex2D(_MainTex, uv32.xy); 33 | c += 0.05 * tex2D(_MainTex, uv32.zw); 34 | c += 0.025 * tex2D(_MainTex, uv45.xy); 35 | c += 0.025 * tex2D(_MainTex, uv45.zw); 36 | c += 0.025 * tex2D(_MainTex, uv54.xy); 37 | c += 0.025 * tex2D(_MainTex, uv54.zw); 38 | 39 | return c; 40 | } 41 | 42 | ENDCG 43 | } 44 | } 45 | FallBack off 46 | } 47 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarBlur.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5401191c1440b294aaa32c0c975fb5d6 3 | timeCreated: 1509775904 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarEffect.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/FogOfWarEffect" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _FogColor("FogColor", color) = (0,0,0,1) 7 | _FogTex ("FogTex", 2D) = "black" {} 8 | _MixValue("MixValue", float) = 0 9 | } 10 | SubShader 11 | { 12 | Cull Off ZWrite Off ZTest Always 13 | 14 | Pass 15 | { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | struct appdata 23 | { 24 | float4 vertex : POSITION; 25 | float2 uv : TEXCOORD0; 26 | }; 27 | 28 | struct v2f 29 | { 30 | float2 uv : TEXCOORD0; 31 | float2 uv_depth : TEXCOORD1; 32 | float3 interpolatedRay : TEXCOORD2; 33 | float4 vertex : SV_POSITION; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | float4 _MainTex_TexelSize; 38 | sampler2D _CameraDepthTexture; 39 | 40 | sampler2D _FogTex; 41 | 42 | half _MixValue; 43 | 44 | half4 _FogColor; 45 | 46 | float4x4 _FrustumCorners; 47 | float4x4 internal_WorldToProjector; 48 | 49 | v2f vert (appdata v) 50 | { 51 | v2f o; 52 | half index = v.vertex.z; 53 | v.vertex.z = 0.1; 54 | o.vertex = UnityObjectToClipPos(v.vertex); 55 | o.uv = v.uv.xy; 56 | o.uv_depth = v.uv.xy; 57 | #if UNITY_UV_STARTS_AT_TOP 58 | if (_MainTex_TexelSize.y < 0) 59 | o.uv.y = 1 - o.uv.y; 60 | #endif 61 | o.interpolatedRay = _FrustumCorners[(int)index].xyz; 62 | return o; 63 | } 64 | 65 | fixed4 frag (v2f i) : SV_Target 66 | { 67 | fixed4 c = tex2D(_MainTex, UnityStereoTransformScreenSpaceTex(i.uv)); 68 | 69 | fixed depth = Linear01Depth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoTransformScreenSpaceTex(i.uv_depth))); 70 | 71 | fixed4 pos = fixed4(depth*i.interpolatedRay, 1); 72 | 73 | pos.xyz += _WorldSpaceCameraPos; 74 | pos = mul(internal_WorldToProjector, pos); 75 | 76 | 77 | pos.xy /= pos.w; 78 | 79 | fixed3 tex = tex2D(_FogTex, pos.xy).rgb; 80 | 81 | float2 atten = saturate((0.5 - abs(pos.xy - 0.5)) / (1 - 0.9)); 82 | 83 | fixed3 col; 84 | col.rgb = lerp(_FogColor.rgb, fixed3(1, 1, 1), tex.r*_FogColor.a); 85 | 86 | fixed visual = lerp(tex.b, tex.g, _MixValue); 87 | col.rgb = lerp(col.rgb, fixed3(1, 1, 1), visual)*atten.x*atten.y; 88 | 89 | c.rgb *= col.rgb; 90 | c.a = 1; 91 | return c; 92 | } 93 | ENDCG 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarEffect.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de59591eb7a71f742a1a396afaf86032 3 | timeCreated: 1509549577 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarMinimap.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/FogOfWarMinimap" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _FogColor("FogColor", color) = (0,0,0,1) 7 | _MixValue("MixValue", float) = 0 8 | } 9 | SubShader 10 | { 11 | Cull Off ZWrite Off ZTest Always 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | 19 | #include "UnityCG.cginc" 20 | 21 | struct appdata 22 | { 23 | float4 vertex : POSITION; 24 | float2 uv : TEXCOORD0; 25 | }; 26 | 27 | struct v2f 28 | { 29 | float2 uv : TEXCOORD0; 30 | float4 vertex : SV_POSITION; 31 | }; 32 | 33 | v2f vert (appdata v) 34 | { 35 | v2f o; 36 | o.vertex = UnityObjectToClipPos(v.vertex); 37 | o.uv = v.uv; 38 | return o; 39 | } 40 | 41 | sampler2D _MainTex; 42 | half _MixValue; 43 | 44 | half4 _FogColor; 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed3 mask = tex2D(_MainTex, i.uv).rgb; 49 | fixed4 col; 50 | col.rgb = _FogColor.rgb; 51 | col.a = saturate(1 - mask.r*_FogColor.a); 52 | 53 | fixed visual = lerp(mask.b, mask.g, _MixValue); 54 | col.a = lerp(col.a, 0, visual); 55 | return col; 56 | } 57 | ENDCG 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Assets/Shaders/FogOfWarMinimap.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a89fe7f556818944b81d4637a0e7f76 3 | timeCreated: 1523891551 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Terrain.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fe7748d46323a1469ec509749927732 3 | folderAsset: yes 4 | timeCreated: 1509373828 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Terrain/New Terrain.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Terrain/New Terrain.asset -------------------------------------------------------------------------------- /Assets/Terrain/New Terrain.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f680d14caeb6b7740a5ef557ea24319d 3 | timeCreated: 1509373823 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 15600000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Terrain/New Terrain2.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Terrain/New Terrain2.asset -------------------------------------------------------------------------------- /Assets/Terrain/New Terrain2.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df364a87bc4366043964f456446a0a80 3 | timeCreated: 1509712921 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 15600000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Terrain/t.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19bf775c7cda0d44db1855b824a309b0 3 | timeCreated: 1509773909 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 4300000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 622118f691dac22469e14a76772a8db4 3 | folderAsset: yes 4 | timeCreated: 1523888185 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Textures/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce234431026a3fe4aa8f70f41ec7e5ca 3 | folderAsset: yes 4 | timeCreated: 1523888185 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Textures/UI/map.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Textures/UI/map.jpg -------------------------------------------------------------------------------- /Assets/Textures/UI/map.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5c16e048139b2e4384b3863a1a303ec 3 | timeCreated: 1523888315 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/Textures/UI/minimap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Textures/UI/minimap.png -------------------------------------------------------------------------------- /Assets/Textures/UI/minimap.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4282dba052eee643b8a1000527d927f 3 | timeCreated: 1523888186 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /Assets/Textures/UI/minimapmask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/Assets/Textures/UI/minimapmask.png -------------------------------------------------------------------------------- /Assets/Textures/UI/minimapmask.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c3e16ce837b07fa4ea871c9ba61e312c 3 | timeCreated: 1523888186 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 1 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 6 25 | cubemapConvolution: 0 26 | seamlessCubemap: 0 27 | textureFormat: 1 28 | maxTextureSize: 2048 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | compressionQuality: 50 37 | spriteMode: 1 38 | spriteExtrude: 1 39 | spriteMeshType: 1 40 | alignment: 0 41 | spritePivot: {x: 0.5, y: 0.5} 42 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 43 | spritePixelsToUnits: 100 44 | alphaUsage: 1 45 | alphaIsTransparency: 1 46 | spriteTessellationDetail: -1 47 | textureType: 8 48 | textureShape: 1 49 | maxTextureSizeSet: 0 50 | compressionQualitySet: 0 51 | textureFormatSet: 0 52 | platformSettings: 53 | - buildTarget: DefaultTexturePlatform 54 | maxTextureSize: 2048 55 | textureFormat: -1 56 | textureCompression: 1 57 | compressionQuality: 50 58 | crunchedCompression: 0 59 | allowsAlphaSplitting: 0 60 | overridden: 0 61 | - buildTarget: Standalone 62 | maxTextureSize: 2048 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | - buildTarget: iPhone 70 | maxTextureSize: 2048 71 | textureFormat: -1 72 | textureCompression: 1 73 | compressionQuality: 50 74 | crunchedCompression: 0 75 | allowsAlphaSplitting: 0 76 | overridden: 0 77 | - buildTarget: Android 78 | maxTextureSize: 2048 79 | textureFormat: -1 80 | textureCompression: 1 81 | compressionQuality: 50 82 | crunchedCompression: 0 83 | allowsAlphaSplitting: 0 84 | overridden: 0 85 | - buildTarget: WebGL 86 | maxTextureSize: 2048 87 | textureFormat: -1 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | spriteSheet: 94 | serializedVersion: 2 95 | sprites: [] 96 | outline: [] 97 | spritePackingTag: 98 | userData: 99 | assetBundleName: 100 | assetBundleVariant: 101 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 AshesL 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 | -------------------------------------------------------------------------------- /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 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /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 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | -------------------------------------------------------------------------------- /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/Example0.unity 10 | guid: 29cd0f7e9efcf594b84bcb01e521efe4 11 | -------------------------------------------------------------------------------- /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_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 0 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | -------------------------------------------------------------------------------- /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: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /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: 0.001 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: 0.001 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: 0.001 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: 0.001 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 shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 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: 0.001 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: 0.1 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: 0.1 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: 0.1 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: 0.19 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: 0.19 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: 0.001 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: 0.001 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: 0.001 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: 0.001 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: 0.001 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: 0.001 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: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | m_SettingNames: 89 | - Humanoid 90 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_CallbacksOnDisable: 1 26 | m_AlwaysShowColliders: 0 27 | m_ShowColliderSleep: 1 28 | m_ShowColliderContacts: 0 29 | m_ShowColliderAABB: 0 30 | m_ContactArrowScale: 0.2 31 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 32 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 33 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 34 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 35 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 36 | -------------------------------------------------------------------------------- /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: 11 7 | productGUID: 26d90d53bdc4e8040a73d8f4fa531d82 8 | AndroidProfiler: 0 9 | defaultScreenOrientation: 4 10 | targetDevice: 2 11 | useOnDemandResources: 0 12 | accelerometerFrequency: 60 13 | companyName: DefaultCompany 14 | productName: FogOfWar 15 | defaultCursor: {fileID: 0} 16 | cursorHotspot: {x: 0, y: 0} 17 | m_SplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21176471, a: 1} 18 | m_ShowUnitySplashScreen: 1 19 | m_ShowUnitySplashLogo: 1 20 | m_SplashScreenOverlayOpacity: 1 21 | m_SplashScreenAnimation: 1 22 | m_SplashScreenLogoStyle: 1 23 | m_SplashScreenDrawMode: 0 24 | m_SplashScreenBackgroundAnimationZoom: 1 25 | m_SplashScreenLogoAnimationZoom: 1 26 | m_SplashScreenBackgroundLandscapeAspect: 1 27 | m_SplashScreenBackgroundPortraitAspect: 1 28 | m_SplashScreenBackgroundLandscapeUvs: 29 | serializedVersion: 2 30 | x: 0 31 | y: 0 32 | width: 1 33 | height: 1 34 | m_SplashScreenBackgroundPortraitUvs: 35 | serializedVersion: 2 36 | x: 0 37 | y: 0 38 | width: 1 39 | height: 1 40 | m_SplashScreenLogos: [] 41 | m_SplashScreenBackgroundLandscape: {fileID: 0} 42 | m_SplashScreenBackgroundPortrait: {fileID: 0} 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_MobileMTRendering: 0 53 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 54 | iosShowActivityIndicatorOnLoading: -1 55 | androidShowActivityIndicatorOnLoading: -1 56 | tizenShowActivityIndicatorOnLoading: -1 57 | iosAppInBackgroundBehavior: 0 58 | displayResolutionDialog: 1 59 | iosAllowHTTPDownload: 1 60 | allowedAutorotateToPortrait: 0 61 | allowedAutorotateToPortraitUpsideDown: 0 62 | allowedAutorotateToLandscapeRight: 1 63 | allowedAutorotateToLandscapeLeft: 1 64 | useOSAutorotation: 1 65 | use32BitDisplayBuffer: 1 66 | disableDepthAndStencilBuffers: 0 67 | defaultIsFullScreen: 1 68 | defaultIsNativeResolution: 1 69 | runInBackground: 0 70 | captureSingleScreen: 0 71 | muteOtherAudioSources: 0 72 | Prepare IOS For Recording: 0 73 | submitAnalytics: 1 74 | usePlayerLog: 1 75 | bakeCollisionMeshes: 0 76 | forceSingleInstance: 0 77 | resizableWindow: 0 78 | useMacAppStoreValidation: 0 79 | macAppStoreCategory: public.app-category.games 80 | gpuSkinning: 0 81 | graphicsJobs: 0 82 | xboxPIXTextureCapture: 0 83 | xboxEnableAvatar: 0 84 | xboxEnableKinect: 0 85 | xboxEnableKinectAutoTracking: 0 86 | xboxEnableFitness: 0 87 | visibleInBackground: 0 88 | allowFullscreenSwitch: 1 89 | graphicsJobMode: 0 90 | macFullscreenMode: 2 91 | d3d9FullscreenMode: 1 92 | d3d11FullscreenMode: 1 93 | xboxSpeechDB: 0 94 | xboxEnableHeadOrientation: 0 95 | xboxEnableGuest: 0 96 | xboxEnablePIXSampling: 0 97 | n3dsDisableStereoscopicView: 0 98 | n3dsEnableSharedListOpt: 1 99 | n3dsEnableVSync: 0 100 | ignoreAlphaClear: 0 101 | xboxOneResolution: 0 102 | xboxOneMonoLoggingLevel: 0 103 | xboxOneLoggingLevel: 1 104 | videoMemoryForVertexBuffers: 0 105 | psp2PowerMode: 0 106 | psp2AcquireBGM: 1 107 | wiiUTVResolution: 0 108 | wiiUGamePadMSAA: 1 109 | wiiUSupportsNunchuk: 0 110 | wiiUSupportsClassicController: 0 111 | wiiUSupportsBalanceBoard: 0 112 | wiiUSupportsMotionPlus: 0 113 | wiiUSupportsProController: 0 114 | wiiUAllowScreenCapture: 1 115 | wiiUControllerCount: 0 116 | m_SupportedAspectRatios: 117 | 4:3: 1 118 | 5:4: 1 119 | 16:10: 1 120 | 16:9: 1 121 | Others: 1 122 | bundleVersion: 1.0 123 | preloadedAssets: [] 124 | metroInputSource: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 0 128 | vrSettings: 129 | cardboard: 130 | depthFormat: 0 131 | enableTransitionView: 0 132 | daydream: 133 | depthFormat: 0 134 | useSustainedPerformanceMode: 0 135 | hololens: 136 | depthFormat: 1 137 | protectGraphicsMemory: 0 138 | useHDRDisplay: 0 139 | applicationIdentifier: 140 | Android: com.asl.FogOfWar 141 | buildNumber: {} 142 | AndroidBundleVersionCode: 1 143 | AndroidMinSdkVersion: 16 144 | AndroidTargetSdkVersion: 0 145 | AndroidPreferredInstallLocation: 1 146 | aotOptions: 147 | stripEngineCode: 1 148 | iPhoneStrippingLevel: 0 149 | iPhoneScriptCallOptimization: 0 150 | ForceInternetPermission: 0 151 | ForceSDCardPermission: 0 152 | CreateWallpaper: 0 153 | APKExpansionFiles: 0 154 | keepLoadedShadersAlive: 0 155 | StripUnusedMeshComponents: 0 156 | VertexChannelCompressionMask: 157 | serializedVersion: 2 158 | m_Bits: 238 159 | iPhoneSdkVersion: 988 160 | iOSTargetOSVersionString: 161 | tvOSSdkVersion: 0 162 | tvOSRequireExtendedGameController: 0 163 | tvOSTargetOSVersionString: 164 | uIPrerenderedIcon: 0 165 | uIRequiresPersistentWiFi: 0 166 | uIRequiresFullScreen: 1 167 | uIStatusBarHidden: 1 168 | uIExitOnSuspend: 0 169 | uIStatusBarStyle: 0 170 | iPhoneSplashScreen: {fileID: 0} 171 | iPhoneHighResSplashScreen: {fileID: 0} 172 | iPhoneTallHighResSplashScreen: {fileID: 0} 173 | iPhone47inSplashScreen: {fileID: 0} 174 | iPhone55inPortraitSplashScreen: {fileID: 0} 175 | iPhone55inLandscapeSplashScreen: {fileID: 0} 176 | iPadPortraitSplashScreen: {fileID: 0} 177 | iPadHighResPortraitSplashScreen: {fileID: 0} 178 | iPadLandscapeSplashScreen: {fileID: 0} 179 | iPadHighResLandscapeSplashScreen: {fileID: 0} 180 | appleTVSplashScreen: {fileID: 0} 181 | tvOSSmallIconLayers: [] 182 | tvOSLargeIconLayers: [] 183 | tvOSTopShelfImageLayers: [] 184 | tvOSTopShelfImageWideLayers: [] 185 | iOSLaunchScreenType: 0 186 | iOSLaunchScreenPortrait: {fileID: 0} 187 | iOSLaunchScreenLandscape: {fileID: 0} 188 | iOSLaunchScreenBackgroundColor: 189 | serializedVersion: 2 190 | rgba: 0 191 | iOSLaunchScreenFillPct: 100 192 | iOSLaunchScreenSize: 100 193 | iOSLaunchScreenCustomXibPath: 194 | iOSLaunchScreeniPadType: 0 195 | iOSLaunchScreeniPadImage: {fileID: 0} 196 | iOSLaunchScreeniPadBackgroundColor: 197 | serializedVersion: 2 198 | rgba: 0 199 | iOSLaunchScreeniPadFillPct: 100 200 | iOSLaunchScreeniPadSize: 100 201 | iOSLaunchScreeniPadCustomXibPath: 202 | iOSDeviceRequirements: [] 203 | iOSURLSchemes: [] 204 | iOSBackgroundModes: 0 205 | iOSMetalForceHardShadows: 0 206 | metalEditorSupport: 1 207 | metalAPIValidation: 1 208 | iOSRenderExtraFrameOnPause: 0 209 | appleDeveloperTeamID: 210 | iOSManualSigningProvisioningProfileID: 211 | tvOSManualSigningProvisioningProfileID: 212 | appleEnableAutomaticSigning: 0 213 | AndroidTargetDevice: 0 214 | AndroidSplashScreenScale: 0 215 | androidSplashScreen: {fileID: 0} 216 | AndroidKeystoreName: 217 | AndroidKeyaliasName: 218 | AndroidTVCompatibility: 1 219 | AndroidIsGame: 1 220 | androidEnableBanner: 1 221 | m_AndroidBanners: 222 | - width: 320 223 | height: 180 224 | banner: {fileID: 0} 225 | androidGamepadSupportLevel: 0 226 | resolutionDialogBanner: {fileID: 0} 227 | m_BuildTargetIcons: [] 228 | m_BuildTargetBatching: [] 229 | m_BuildTargetGraphicsAPIs: [] 230 | m_BuildTargetVRSettings: [] 231 | openGLRequireES31: 0 232 | openGLRequireES31AEP: 0 233 | webPlayerTemplate: APPLICATION:Default 234 | m_TemplateCustomTags: {} 235 | wiiUTitleID: 0005000011000000 236 | wiiUGroupID: 00010000 237 | wiiUCommonSaveSize: 4096 238 | wiiUAccountSaveSize: 2048 239 | wiiUOlvAccessKey: 0 240 | wiiUTinCode: 0 241 | wiiUJoinGameId: 0 242 | wiiUJoinGameModeMask: 0000000000000000 243 | wiiUCommonBossSize: 0 244 | wiiUAccountBossSize: 0 245 | wiiUAddOnUniqueIDs: [] 246 | wiiUMainThreadStackSize: 3072 247 | wiiULoaderThreadStackSize: 1024 248 | wiiUSystemHeapSize: 128 249 | wiiUTVStartupScreen: {fileID: 0} 250 | wiiUGamePadStartupScreen: {fileID: 0} 251 | wiiUDrcBufferDisabled: 0 252 | wiiUProfilerLibPath: 253 | playModeTestRunnerEnabled: 0 254 | actionOnDotNetUnhandledException: 1 255 | enableInternalProfiler: 0 256 | logObjCUncaughtExceptions: 1 257 | enableCrashReportAPI: 0 258 | cameraUsageDescription: 259 | locationUsageDescription: 260 | microphoneUsageDescription: 261 | switchNetLibKey: 262 | switchSocketMemoryPoolSize: 6144 263 | switchSocketAllocatorPoolSize: 128 264 | switchSocketConcurrencyLimit: 14 265 | switchScreenResolutionBehavior: 2 266 | switchUseCPUProfiler: 0 267 | switchApplicationID: 0x01004b9000490000 268 | switchNSODependencies: 269 | switchTitleNames_0: 270 | switchTitleNames_1: 271 | switchTitleNames_2: 272 | switchTitleNames_3: 273 | switchTitleNames_4: 274 | switchTitleNames_5: 275 | switchTitleNames_6: 276 | switchTitleNames_7: 277 | switchTitleNames_8: 278 | switchTitleNames_9: 279 | switchTitleNames_10: 280 | switchTitleNames_11: 281 | switchPublisherNames_0: 282 | switchPublisherNames_1: 283 | switchPublisherNames_2: 284 | switchPublisherNames_3: 285 | switchPublisherNames_4: 286 | switchPublisherNames_5: 287 | switchPublisherNames_6: 288 | switchPublisherNames_7: 289 | switchPublisherNames_8: 290 | switchPublisherNames_9: 291 | switchPublisherNames_10: 292 | switchPublisherNames_11: 293 | switchIcons_0: {fileID: 0} 294 | switchIcons_1: {fileID: 0} 295 | switchIcons_2: {fileID: 0} 296 | switchIcons_3: {fileID: 0} 297 | switchIcons_4: {fileID: 0} 298 | switchIcons_5: {fileID: 0} 299 | switchIcons_6: {fileID: 0} 300 | switchIcons_7: {fileID: 0} 301 | switchIcons_8: {fileID: 0} 302 | switchIcons_9: {fileID: 0} 303 | switchIcons_10: {fileID: 0} 304 | switchIcons_11: {fileID: 0} 305 | switchSmallIcons_0: {fileID: 0} 306 | switchSmallIcons_1: {fileID: 0} 307 | switchSmallIcons_2: {fileID: 0} 308 | switchSmallIcons_3: {fileID: 0} 309 | switchSmallIcons_4: {fileID: 0} 310 | switchSmallIcons_5: {fileID: 0} 311 | switchSmallIcons_6: {fileID: 0} 312 | switchSmallIcons_7: {fileID: 0} 313 | switchSmallIcons_8: {fileID: 0} 314 | switchSmallIcons_9: {fileID: 0} 315 | switchSmallIcons_10: {fileID: 0} 316 | switchSmallIcons_11: {fileID: 0} 317 | switchManualHTML: 318 | switchAccessibleURLs: 319 | switchLegalInformation: 320 | switchMainThreadStackSize: 1048576 321 | switchPresenceGroupId: 322 | switchLogoHandling: 0 323 | switchReleaseVersion: 0 324 | switchDisplayVersion: 1.0.0 325 | switchStartupUserAccount: 0 326 | switchTouchScreenUsage: 0 327 | switchSupportedLanguagesMask: 0 328 | switchLogoType: 0 329 | switchApplicationErrorCodeCategory: 330 | switchUserAccountSaveDataSize: 0 331 | switchUserAccountSaveDataJournalSize: 0 332 | switchApplicationAttribute: 0 333 | switchCardSpecSize: -1 334 | switchCardSpecClock: -1 335 | switchRatingsMask: 0 336 | switchRatingsInt_0: 0 337 | switchRatingsInt_1: 0 338 | switchRatingsInt_2: 0 339 | switchRatingsInt_3: 0 340 | switchRatingsInt_4: 0 341 | switchRatingsInt_5: 0 342 | switchRatingsInt_6: 0 343 | switchRatingsInt_7: 0 344 | switchRatingsInt_8: 0 345 | switchRatingsInt_9: 0 346 | switchRatingsInt_10: 0 347 | switchRatingsInt_11: 0 348 | switchLocalCommunicationIds_0: 349 | switchLocalCommunicationIds_1: 350 | switchLocalCommunicationIds_2: 351 | switchLocalCommunicationIds_3: 352 | switchLocalCommunicationIds_4: 353 | switchLocalCommunicationIds_5: 354 | switchLocalCommunicationIds_6: 355 | switchLocalCommunicationIds_7: 356 | switchParentalControl: 0 357 | switchAllowsScreenshot: 1 358 | switchDataLossConfirmation: 0 359 | switchSupportedNpadStyles: 3 360 | switchSocketConfigEnabled: 0 361 | switchTcpInitialSendBufferSize: 32 362 | switchTcpInitialReceiveBufferSize: 64 363 | switchTcpAutoSendBufferSizeMax: 256 364 | switchTcpAutoReceiveBufferSizeMax: 256 365 | switchUdpSendBufferSize: 9 366 | switchUdpReceiveBufferSize: 42 367 | switchSocketBufferEfficiency: 4 368 | switchSocketInitializeEnabled: 1 369 | switchNetworkInterfaceManagerInitializeEnabled: 1 370 | switchPlayerConnectionEnabled: 1 371 | ps4NPAgeRating: 12 372 | ps4NPTitleSecret: 373 | ps4NPTrophyPackPath: 374 | ps4ParentalLevel: 11 375 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 376 | ps4Category: 0 377 | ps4MasterVersion: 01.00 378 | ps4AppVersion: 01.00 379 | ps4AppType: 0 380 | ps4ParamSfxPath: 381 | ps4VideoOutPixelFormat: 0 382 | ps4VideoOutInitialWidth: 1920 383 | ps4VideoOutBaseModeInitialWidth: 1920 384 | ps4VideoOutReprojectionRate: 120 385 | ps4PronunciationXMLPath: 386 | ps4PronunciationSIGPath: 387 | ps4BackgroundImagePath: 388 | ps4StartupImagePath: 389 | ps4SaveDataImagePath: 390 | ps4SdkOverride: 391 | ps4BGMPath: 392 | ps4ShareFilePath: 393 | ps4ShareOverlayImagePath: 394 | ps4PrivacyGuardImagePath: 395 | ps4NPtitleDatPath: 396 | ps4RemotePlayKeyAssignment: -1 397 | ps4RemotePlayKeyMappingDir: 398 | ps4PlayTogetherPlayerCount: 0 399 | ps4EnterButtonAssignment: 1 400 | ps4ApplicationParam1: 0 401 | ps4ApplicationParam2: 0 402 | ps4ApplicationParam3: 0 403 | ps4ApplicationParam4: 0 404 | ps4DownloadDataSize: 0 405 | ps4GarlicHeapSize: 2048 406 | ps4ProGarlicHeapSize: 2560 407 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 408 | ps4UseDebugIl2cppLibs: 0 409 | ps4pnSessions: 1 410 | ps4pnPresence: 1 411 | ps4pnFriends: 1 412 | ps4pnGameCustomData: 1 413 | playerPrefsSupport: 0 414 | restrictedAudioUsageRights: 0 415 | ps4UseResolutionFallback: 0 416 | ps4ReprojectionSupport: 0 417 | ps4UseAudio3dBackend: 0 418 | ps4SocialScreenEnabled: 0 419 | ps4ScriptOptimizationLevel: 3 420 | ps4Audio3dVirtualSpeakerCount: 14 421 | ps4attribCpuUsage: 0 422 | ps4PatchPkgPath: 423 | ps4PatchLatestPkgPath: 424 | ps4PatchChangeinfoPath: 425 | ps4PatchDayOne: 0 426 | ps4attribUserManagement: 0 427 | ps4attribMoveSupport: 0 428 | ps4attrib3DSupport: 0 429 | ps4attribShareSupport: 0 430 | ps4attribExclusiveVR: 0 431 | ps4disableAutoHideSplash: 0 432 | ps4videoRecordingFeaturesUsed: 0 433 | ps4contentSearchFeaturesUsed: 0 434 | ps4attribEyeToEyeDistanceSettingVR: 0 435 | ps4IncludedModules: [] 436 | monoEnv: 437 | psp2Splashimage: {fileID: 0} 438 | psp2NPTrophyPackPath: 439 | psp2NPSupportGBMorGJP: 0 440 | psp2NPAgeRating: 12 441 | psp2NPTitleDatPath: 442 | psp2NPCommsID: 443 | psp2NPCommunicationsID: 444 | psp2NPCommsPassphrase: 445 | psp2NPCommsSig: 446 | psp2ParamSfxPath: 447 | psp2ManualPath: 448 | psp2LiveAreaGatePath: 449 | psp2LiveAreaBackroundPath: 450 | psp2LiveAreaPath: 451 | psp2LiveAreaTrialPath: 452 | psp2PatchChangeInfoPath: 453 | psp2PatchOriginalPackage: 454 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 455 | psp2KeystoneFile: 456 | psp2MemoryExpansionMode: 0 457 | psp2DRMType: 0 458 | psp2StorageType: 0 459 | psp2MediaCapacity: 0 460 | psp2DLCConfigPath: 461 | psp2ThumbnailPath: 462 | psp2BackgroundPath: 463 | psp2SoundPath: 464 | psp2TrophyCommId: 465 | psp2TrophyPackagePath: 466 | psp2PackagedResourcesPath: 467 | psp2SaveDataQuota: 10240 468 | psp2ParentalLevel: 1 469 | psp2ShortTitle: Not Set 470 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 471 | psp2Category: 0 472 | psp2MasterVersion: 01.00 473 | psp2AppVersion: 01.00 474 | psp2TVBootMode: 0 475 | psp2EnterButtonAssignment: 2 476 | psp2TVDisableEmu: 0 477 | psp2AllowTwitterDialog: 1 478 | psp2Upgradable: 0 479 | psp2HealthWarning: 0 480 | psp2UseLibLocation: 0 481 | psp2InfoBarOnStartup: 0 482 | psp2InfoBarColor: 0 483 | psp2UseDebugIl2cppLibs: 0 484 | psmSplashimage: {fileID: 0} 485 | splashScreenBackgroundSourceLandscape: {fileID: 0} 486 | splashScreenBackgroundSourcePortrait: {fileID: 0} 487 | spritePackerPolicy: 488 | webGLMemorySize: 256 489 | webGLExceptionSupport: 1 490 | webGLNameFilesAsHashes: 0 491 | webGLDataCaching: 0 492 | webGLDebugSymbols: 0 493 | webGLEmscriptenArgs: 494 | webGLModulesDirectory: 495 | webGLTemplate: APPLICATION:Default 496 | webGLAnalyzeBuildSize: 0 497 | webGLUseEmbeddedResources: 0 498 | webGLUseWasm: 0 499 | webGLCompressionFormat: 1 500 | scriptingDefineSymbols: {} 501 | platformArchitecture: {} 502 | scriptingBackend: {} 503 | incrementalIl2cppBuild: {} 504 | additionalIl2CppArgs: 505 | apiCompatibilityLevelPerPlatform: {} 506 | m_RenderingPath: 1 507 | m_MobileRenderingPath: 1 508 | metroPackageName: FogOfWar 509 | metroPackageVersion: 510 | metroCertificatePath: 511 | metroCertificatePassword: 512 | metroCertificateSubject: 513 | metroCertificateIssuer: 514 | metroCertificateNotAfter: 0000000000000000 515 | metroApplicationDescription: FogOfWar 516 | wsaImages: {} 517 | metroTileShortName: 518 | metroCommandLineArgsFile: 519 | metroTileShowName: 0 520 | metroMediumTileShowName: 0 521 | metroLargeTileShowName: 0 522 | metroWideTileShowName: 0 523 | metroDefaultTileSize: 1 524 | metroTileForegroundText: 2 525 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 526 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 527 | a: 1} 528 | metroSplashScreenUseBackgroundColor: 0 529 | platformCapabilities: {} 530 | metroFTAName: 531 | metroFTAFileTypes: [] 532 | metroProtocolName: 533 | metroCompilationOverrides: 1 534 | tizenProductDescription: 535 | tizenProductURL: 536 | tizenSigningProfileName: 537 | tizenGPSPermissions: 0 538 | tizenMicrophonePermissions: 0 539 | tizenDeploymentTarget: 540 | tizenDeploymentTargetType: -1 541 | tizenMinOSVersion: 1 542 | n3dsUseExtSaveData: 0 543 | n3dsCompressStaticMem: 1 544 | n3dsExtSaveDataNumber: 0x12345 545 | n3dsStackSize: 131072 546 | n3dsTargetPlatform: 2 547 | n3dsRegion: 7 548 | n3dsMediaSize: 0 549 | n3dsLogoStyle: 3 550 | n3dsTitle: GameName 551 | n3dsProductCode: 552 | n3dsApplicationId: 0xFF3FF 553 | stvDeviceAddress: 554 | stvProductDescription: 555 | stvProductAuthor: 556 | stvProductAuthorEmail: 557 | stvProductLink: 558 | stvProductCategory: 0 559 | XboxOneProductId: 560 | XboxOneUpdateKey: 561 | XboxOneSandboxId: 562 | XboxOneContentId: 563 | XboxOneTitleId: 564 | XboxOneSCId: 565 | XboxOneGameOsOverridePath: 566 | XboxOnePackagingOverridePath: 567 | XboxOneAppManifestOverridePath: 568 | XboxOnePackageEncryption: 0 569 | XboxOnePackageUpdateGranularity: 2 570 | XboxOneDescription: 571 | XboxOneLanguage: 572 | - enus 573 | XboxOneCapability: [] 574 | XboxOneGameRating: {} 575 | XboxOneIsContentPackage: 0 576 | XboxOneEnableGPUVariability: 0 577 | XboxOneSockets: {} 578 | XboxOneSplashScreen: {fileID: 0} 579 | XboxOneAllowedProductIds: [] 580 | XboxOnePersistentLocalStorageSize: 0 581 | xboxOneScriptCompiler: 0 582 | vrEditorSettings: 583 | daydream: 584 | daydreamIconForeground: {fileID: 0} 585 | daydreamIconBackground: {fileID: 0} 586 | cloudServicesEnabled: {} 587 | facebookSdkVersion: 7.9.1 588 | apiCompatibilityLevel: 2 589 | cloudProjectId: 590 | projectName: 591 | organizationId: 592 | cloudEnabled: 0 593 | enableNewInputSystem: 0 594 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.3p2 2 | -------------------------------------------------------------------------------- /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: 5 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 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 3 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 3 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 1 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 3 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 3 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 4 142 | shadows: 2 143 | shadowResolution: 2 144 | shadowProjection: 1 145 | shadowCascades: 4 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 3 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 150 | blendWeights: 4 151 | textureQuality: 0 152 | anisotropicTextures: 2 153 | antiAliasing: 2 154 | softParticles: 1 155 | softVegetation: 1 156 | realtimeReflectionProbes: 1 157 | billboardsFaceCameraPosition: 1 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: 166 | Android: 2 167 | Nintendo 3DS: 5 168 | PS4: 5 169 | PSM: 5 170 | PSP2: 2 171 | Samsung TV: 2 172 | Standalone: 5 173 | Switch: 5 174 | Tizen: 2 175 | Web: 5 176 | WebGL: 3 177 | WiiU: 5 178 | Windows Store Apps: 5 179 | XboxOne: 5 180 | iPhone: 2 181 | tvOS: 2 182 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /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: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_Enabled: 0 14 | m_CaptureEditorExceptions: 1 15 | UnityPurchasingSettings: 16 | m_Enabled: 0 17 | m_TestMode: 0 18 | UnityAnalyticsSettings: 19 | m_Enabled: 0 20 | m_InitializeOnStartup: 1 21 | m_TestMode: 0 22 | m_TestEventUrl: 23 | m_TestConfigUrl: 24 | UnityAdsSettings: 25 | m_Enabled: 0 26 | m_InitializeOnStartup: 1 27 | m_TestMode: 0 28 | m_EnabledPlatforms: 4294967295 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | PerformanceReportingSettings: 32 | m_Enabled: 0 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FogOfWar 2 | 3 | Unity下实现的渲染可见区域的战争迷雾 4 | 5 | ![1](doc/fog_0.gif) 6 | 7 | ![2](doc/fog_1.gif) 8 | 9 | 一、支持: 10 | 11 | 1、基于视野(FOV)的战争迷雾 12 | 13 | 2、简单圆形区域的战争迷雾 14 | 15 | 3、可以预计算场景障碍物信息 16 | 17 | 4、提供接口访问战争迷雾纹理,理论上可以方便的制作具备战争迷雾效果的小地图功能。 18 | 19 | 5、编辑器下预览战争迷雾纹理信息: 20 | 21 | ​ ![3](doc/preview.JPG) 22 | 23 | 24 | 25 | 二、使用说明: 26 | 27 | 1.FogOfWarEffect为战争迷雾渲染组件,需要添加到主摄像机 28 | 29 | 2.FogOfWarExplorer为探索者,添加该组件的物体将渲染可见区域(己方) 30 | 31 | 3.FogOfWarStalker为潜行者,添加该组件的物体在迷雾区域将不可见(敌方) 32 | -------------------------------------------------------------------------------- /doc/fog_0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/doc/fog_0.gif -------------------------------------------------------------------------------- /doc/fog_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/doc/fog_1.gif -------------------------------------------------------------------------------- /doc/preview.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AsehesL/FogOfWar/4219c8c5271422c3d81572234fa2ff8024af77b9/doc/preview.JPG --------------------------------------------------------------------------------