├── .gitattributes ├── .gitignore ├── Assets ├── .gitignore ├── Scenes.meta ├── Scenes │ ├── Pathfinding Test.unity │ └── Pathfinding Test.unity.meta ├── Scripts.meta └── Scripts │ ├── Components.cs │ ├── Components.cs.meta │ ├── Editor.meta │ ├── Editor │ ├── InitializePathfindingEditor.cs │ └── InitializePathfindingEditor.cs.meta │ ├── InitializePathfinding.cs │ ├── InitializePathfinding.cs.meta │ ├── NativeMinHeap.cs │ ├── NativeMinHeap.cs.meta │ ├── PathfindingSystem.cs │ ├── PathfindingSystem.cs.meta │ ├── RequiredExtensions.cs │ └── RequiredExtensions.cs.meta ├── ECSPathfinding.PNG ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | # Unity files 4 | *.meta -text merge=unityyamlmerge diff 5 | *.unity -text merge=unityyamlmerge diff 6 | *.asset -text merge=unityyamlmerge diff 7 | *.prefab -text merge=unityyamlmerge diff 8 | *.mat -text merge=unityyamlmerge diff 9 | *.anim -text merge=unityyamlmerge diff 10 | *.controller -text merge=unityyamlmerge diff 11 | *.overrideController -text merge=unityyamlmerge diff 12 | *.physicMaterial -text merge=unityyamlmerge diff 13 | *.physicsMaterial2D -text merge=unityyamlmerge diff 14 | *.playable -text merge=unityyamlmerge diff 15 | *.mask -text merge=unityyamlmerge diff 16 | *.brush -text merge=unityyamlmerge diff 17 | *.flare -text merge=unityyamlmerge diff 18 | *.fontsettings -text merge=unityyamlmerge diff 19 | *.guiskin -text merge=unityyamlmerge diff 20 | *.giparams -text merge=unityyamlmerge diff 21 | *.renderTexture -text merge=unityyamlmerge diff 22 | *.spriteatlas -text merge=unityyamlmerge diff 23 | *.terrainlayer -text merge=unityyamlmerge diff 24 | *.mixer -text merge=unityyamlmerge diff 25 | *.shadervariants -text merge=unityyamlmerge diff 26 | 27 | # Image formats 28 | *.psd filter=lfs diff=lfs merge=lfs -text 29 | *.jpg filter=lfs diff=lfs merge=lfs -text 30 | *.png filter=lfs diff=lfs merge=lfs -text 31 | *.gif filter=lfs diff=lfs merge=lfs -text 32 | *.bmp filter=lfs diff=lfs merge=lfs -text 33 | *.tga filter=lfs diff=lfs merge=lfs -text 34 | *.tiff filter=lfs diff=lfs merge=lfs -text 35 | *.tif filter=lfs diff=lfs merge=lfs -text 36 | *.iff filter=lfs diff=lfs merge=lfs -text 37 | *.pict filter=lfs diff=lfs merge=lfs -text 38 | *.dds filter=lfs diff=lfs merge=lfs -text 39 | *.xcf filter=lfs diff=lfs merge=lfs -text 40 | 41 | # Audio formats 42 | *.mp3 filter=lfs diff=lfs merge=lfs -text 43 | *.ogg filter=lfs diff=lfs merge=lfs -text 44 | *.wav filter=lfs diff=lfs merge=lfs -text 45 | *.aiff filter=lfs diff=lfs merge=lfs -text 46 | *.aif filter=lfs diff=lfs merge=lfs -text 47 | *.mod filter=lfs diff=lfs merge=lfs -text 48 | *.it filter=lfs diff=lfs merge=lfs -text 49 | *.s3m filter=lfs diff=lfs merge=lfs -text 50 | *.xm filter=lfs diff=lfs merge=lfs -text 51 | 52 | # Video formats 53 | *.mov filter=lfs diff=lfs merge=lfs -text 54 | *.avi filter=lfs diff=lfs merge=lfs -text 55 | *.asf filter=lfs diff=lfs merge=lfs -text 56 | *.mpg filter=lfs diff=lfs merge=lfs -text 57 | *.mpeg filter=lfs diff=lfs merge=lfs -text 58 | *.mp4 filter=lfs diff=lfs merge=lfs -text 59 | 60 | # 3D formats 61 | *.fbx filter=lfs diff=lfs merge=lfs -text 62 | *.obj filter=lfs diff=lfs merge=lfs -text 63 | *.max filter=lfs diff=lfs merge=lfs -text 64 | *.blend filter=lfs diff=lfs merge=lfs -text 65 | *.dae filter=lfs diff=lfs merge=lfs -text 66 | *.mb filter=lfs diff=lfs merge=lfs -text 67 | *.ma filter=lfs diff=lfs merge=lfs -text 68 | *.3ds filter=lfs diff=lfs merge=lfs -text 69 | *.dfx filter=lfs diff=lfs merge=lfs -text 70 | *.c4d filter=lfs diff=lfs merge=lfs -text 71 | *.lwo filter=lfs diff=lfs merge=lfs -text 72 | *.lwo2 filter=lfs diff=lfs merge=lfs -text 73 | *.abc filter=lfs diff=lfs merge=lfs -text 74 | *.3dm filter=lfs diff=lfs merge=lfs -text 75 | 76 | # Build 77 | *.dll filter=lfs diff=lfs merge=lfs -text 78 | *.pdb filter=lfs diff=lfs merge=lfs -text 79 | *.mdb filter=lfs diff=lfs merge=lfs -text 80 | 81 | # Packaging 82 | *.zip filter=lfs diff=lfs merge=lfs -text 83 | *.7z filter=lfs diff=lfs merge=lfs -text 84 | *.gz filter=lfs diff=lfs merge=lfs -text 85 | *.rar filter=lfs diff=lfs merge=lfs -text 86 | *.tar filter=lfs diff=lfs merge=lfs -text 87 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | [Ll]ogs/ 7 | 8 | # Uncomment this line if you wish to ignore the asset store tools plugin 9 | # [Aa]ssets/AssetStoreTools* 10 | 11 | # Visual Studio cache directory 12 | .vs/ 13 | 14 | # Gradle cache directory 15 | .gradle/ 16 | 17 | # Autogenerated VS/MD/Consulo solution and project files 18 | ExportedObj/ 19 | .consulo/ 20 | *.csproj 21 | *.unityproj 22 | *.sln 23 | *.suo 24 | *.tmp 25 | *.user 26 | *.userprefs 27 | *.pidb 28 | *.booproj 29 | *.svd 30 | *.pdb 31 | *.mdb 32 | *.opendb 33 | *.VC.db 34 | 35 | # Unity3D generated meta files 36 | *.pidb.meta 37 | *.pdb.meta 38 | *.mdb.meta 39 | 40 | # Unity3D generated file on crash reports 41 | sysinfo.txt 42 | 43 | # Builds 44 | *.apk 45 | *.unitypackage 46 | 47 | # Crashlytics generated file 48 | crashlytics-build.properties 49 | -------------------------------------------------------------------------------- /Assets/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Omniaffix-Dave/Unity-2D-Pathfinding-Grid-ECS-Job/633f4f04355587cd7dcfcfc492b5149acdb5e2e9/Assets/.gitignore -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d0f17b9427f0c9458cd4113831e6e7e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/Pathfinding Test.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 0 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightingDataAsset: {fileID: 0} 100 | m_UseShadowmask: 1 101 | --- !u!196 &4 102 | NavMeshSettings: 103 | serializedVersion: 2 104 | m_ObjectHideFlags: 0 105 | m_BuildSettings: 106 | serializedVersion: 2 107 | agentTypeID: 0 108 | agentRadius: 0.5 109 | agentHeight: 2 110 | agentSlope: 45 111 | agentClimb: 0.4 112 | ledgeDropHeight: 0 113 | maxJumpAcrossDistance: 0 114 | minRegionArea: 2 115 | manualCellSize: 0 116 | cellSize: 0.16666667 117 | manualTileSize: 0 118 | tileSize: 256 119 | accuratePlacement: 0 120 | debug: 121 | m_Flags: 0 122 | m_NavMeshData: {fileID: 0} 123 | --- !u!1 &519420028 124 | GameObject: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | serializedVersion: 6 130 | m_Component: 131 | - component: {fileID: 519420032} 132 | - component: {fileID: 519420031} 133 | - component: {fileID: 519420029} 134 | m_Layer: 0 135 | m_Name: Main Camera 136 | m_TagString: MainCamera 137 | m_Icon: {fileID: 0} 138 | m_NavMeshLayer: 0 139 | m_StaticEditorFlags: 0 140 | m_IsActive: 1 141 | --- !u!81 &519420029 142 | AudioListener: 143 | m_ObjectHideFlags: 0 144 | m_CorrespondingSourceObject: {fileID: 0} 145 | m_PrefabInstance: {fileID: 0} 146 | m_PrefabAsset: {fileID: 0} 147 | m_GameObject: {fileID: 519420028} 148 | m_Enabled: 1 149 | --- !u!20 &519420031 150 | Camera: 151 | m_ObjectHideFlags: 0 152 | m_CorrespondingSourceObject: {fileID: 0} 153 | m_PrefabInstance: {fileID: 0} 154 | m_PrefabAsset: {fileID: 0} 155 | m_GameObject: {fileID: 519420028} 156 | m_Enabled: 1 157 | serializedVersion: 2 158 | m_ClearFlags: 2 159 | m_BackGroundColor: {r: 0.22561409, g: 0.2332631, b: 0.24528301, a: 0} 160 | m_projectionMatrixMode: 1 161 | m_GateFitMode: 2 162 | m_FOVAxisMode: 0 163 | m_SensorSize: {x: 36, y: 24} 164 | m_LensShift: {x: 0, y: 0} 165 | m_FocalLength: 50 166 | m_NormalizedViewPortRect: 167 | serializedVersion: 2 168 | x: 0 169 | y: 0 170 | width: 1 171 | height: 1 172 | near clip plane: 0.3 173 | far clip plane: 1000 174 | field of view: 60 175 | orthographic: 1 176 | orthographic size: 56 177 | m_Depth: -1 178 | m_CullingMask: 179 | serializedVersion: 2 180 | m_Bits: 4294967295 181 | m_RenderingPath: -1 182 | m_TargetTexture: {fileID: 0} 183 | m_TargetDisplay: 0 184 | m_TargetEye: 0 185 | m_HDR: 1 186 | m_AllowMSAA: 0 187 | m_AllowDynamicResolution: 0 188 | m_ForceIntoRT: 0 189 | m_OcclusionCulling: 0 190 | m_StereoConvergence: 10 191 | m_StereoSeparation: 0.022 192 | --- !u!4 &519420032 193 | Transform: 194 | m_ObjectHideFlags: 0 195 | m_CorrespondingSourceObject: {fileID: 0} 196 | m_PrefabInstance: {fileID: 0} 197 | m_PrefabAsset: {fileID: 0} 198 | m_GameObject: {fileID: 519420028} 199 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 200 | m_LocalPosition: {x: 50, y: 50, z: -10} 201 | m_LocalScale: {x: 1, y: 1, z: 1} 202 | m_Children: [] 203 | m_Father: {fileID: 0} 204 | m_RootOrder: 0 205 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 206 | --- !u!1 &1508223371 207 | GameObject: 208 | m_ObjectHideFlags: 0 209 | m_CorrespondingSourceObject: {fileID: 0} 210 | m_PrefabInstance: {fileID: 0} 211 | m_PrefabAsset: {fileID: 0} 212 | serializedVersion: 6 213 | m_Component: 214 | - component: {fileID: 1508223373} 215 | - component: {fileID: 1508223372} 216 | m_Layer: 0 217 | m_Name: Initializer 218 | m_TagString: Untagged 219 | m_Icon: {fileID: 0} 220 | m_NavMeshLayer: 0 221 | m_StaticEditorFlags: 0 222 | m_IsActive: 1 223 | --- !u!114 &1508223372 224 | MonoBehaviour: 225 | m_ObjectHideFlags: 0 226 | m_CorrespondingSourceObject: {fileID: 0} 227 | m_PrefabInstance: {fileID: 0} 228 | m_PrefabAsset: {fileID: 0} 229 | m_GameObject: {fileID: 1508223371} 230 | m_Enabled: 1 231 | m_EditorHideFlags: 0 232 | m_Script: {fileID: 11500000, guid: c17199525bd4ea1418796ce41745946d, type: 3} 233 | m_Name: 234 | m_EditorClassIdentifier: 235 | size: 236 | x: 100 237 | y: 100 238 | showGrid: 1 239 | showPaths: 1 240 | canMoveDiag: 1 241 | pathColor: {r: 0, g: 0.21920633, b: 1, a: 1} 242 | start: {x: 0, y: 0} 243 | end: {x: 0, y: 0} 244 | searchManualPath: 0 245 | numOfRandomPaths: 50 246 | searchRandomPaths: 0 247 | blockedNode: {x: 0, y: 0} 248 | addManualBlockedNode: 0 249 | numbOfRandomBlockedNodes: 500 250 | addRandomBlockedNode: 0 251 | --- !u!4 &1508223373 252 | Transform: 253 | m_ObjectHideFlags: 0 254 | m_CorrespondingSourceObject: {fileID: 0} 255 | m_PrefabInstance: {fileID: 0} 256 | m_PrefabAsset: {fileID: 0} 257 | m_GameObject: {fileID: 1508223371} 258 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 259 | m_LocalPosition: {x: 0, y: 0, z: 0} 260 | m_LocalScale: {x: 1, y: 1, z: 1} 261 | m_Children: [] 262 | m_Father: {fileID: 0} 263 | m_RootOrder: 1 264 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 265 | -------------------------------------------------------------------------------- /Assets/Scenes/Pathfinding Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cda990e2423bbf4892e6590ba056729 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ea142f1fa832d549b5b9102c8d07062 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Components.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using System; 6 | 7 | namespace Pathfinding 8 | { 9 | public struct PathRequest : IComponentData 10 | { 11 | public Entity Entity; 12 | 13 | public int2 start; 14 | public int2 end; 15 | public float3 Destination; 16 | public bool NavigateToNearestIfBlocked; 17 | public bool NavigateToBestIfIncomplete; 18 | 19 | public bool fufilled; 20 | 21 | } 22 | 23 | public struct Neighbour 24 | { 25 | public readonly float Distance; 26 | public readonly int2 Offset; 27 | 28 | public Neighbour(int x, int y) 29 | { 30 | if (x < -1 || x > 1) 31 | { 32 | throw new ArgumentOutOfRangeException( 33 | nameof(x), 34 | $"Parameter {nameof(x)} cannot have a magnitude larger than one"); 35 | } 36 | 37 | if (y < -1 || y > 1) 38 | { 39 | throw new ArgumentOutOfRangeException( 40 | nameof(y), 41 | $"Parameter {nameof(y)} cannot have a magnitude larger than one"); 42 | } 43 | 44 | if (x == 0 && y == 0) 45 | { 46 | throw new ArgumentException( 47 | nameof(y), 48 | $"Paramters {nameof(x)} and {nameof(y)} cannot both be zero"); 49 | } 50 | 51 | this.Offset = new int2(x, y); 52 | 53 | // Penalize diagonal movement 54 | this.Distance = x != 0 && y != 0 ? 1.41421f : 1; 55 | } 56 | } 57 | 58 | [Serializable] 59 | public struct NavigationCapabilities : IComponentData 60 | { 61 | public float MaxSlopeAngle; 62 | public float MaxClimbHeight; 63 | public float MaxDropHeight; 64 | } 65 | 66 | public struct Waypoint : IBufferElementData 67 | { 68 | public float3 waypoints; 69 | } 70 | public struct Cell 71 | { 72 | public bool Blocked 73 | { 74 | get { return Convert.ToBoolean(blocked); } 75 | } 76 | public int Height; 77 | public byte blocked; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/Scripts/Components.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93ba47dbbb47c5445a6c7e938bd20b86 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e62367d0b749264c88d9aa307f6d267 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/InitializePathfindingEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | namespace Pathfinding 5 | { 6 | [CustomEditor(typeof(InitializePathfinding))] 7 | //[CanEditMultipleObjects] 8 | public class InitializerEditor : Editor 9 | { 10 | InitializePathfinding pathfinding => (InitializePathfinding)target; 11 | 12 | SerializedProperty numberOfRandomPaths => serializedObject.FindProperty("numOfRandomPaths"); 13 | SerializedProperty startManualPath => serializedObject.FindProperty("start"); 14 | SerializedProperty endManualPath => serializedObject.FindProperty("end"); 15 | 16 | SerializedProperty numberOfBlocksToAdd => serializedObject.FindProperty("numbOfRandomBlockedNodes"); 17 | SerializedProperty manualBlockNode => serializedObject.FindProperty("blockedNode"); 18 | 19 | SerializedProperty size; 20 | 21 | bool showBlocked; 22 | bool showPaths; 23 | 24 | public override void OnInspectorGUI() 25 | { 26 | base.OnInspectorGUI(); 27 | 28 | showPaths = EditorGUILayout.Foldout(showPaths, "Paths"); 29 | 30 | if (showPaths) 31 | ShowPaths(); 32 | 33 | showBlocked = EditorGUILayout.Foldout(showBlocked, "Blocked Nodes"); 34 | 35 | if (showBlocked) 36 | ShowBlockedNodes(); 37 | } 38 | 39 | void ShowPaths() 40 | { 41 | EditorGUILayout.PropertyField(numberOfRandomPaths, new GUIContent("Number To Generate")); 42 | if (GUILayout.Button("Add Random Paths")) 43 | { 44 | pathfinding.searchRandomPaths = true; 45 | } 46 | 47 | EditorGUILayout.PropertyField(startManualPath, new GUIContent("Start Node")); 48 | EditorGUILayout.PropertyField(endManualPath, new GUIContent("End Node")); 49 | if (GUILayout.Button("Add Manual Path")) 50 | pathfinding.searchManualPath = true; 51 | 52 | serializedObject.ApplyModifiedProperties(); 53 | } 54 | 55 | void ShowBlockedNodes() 56 | { 57 | EditorGUILayout.PropertyField(numberOfBlocksToAdd, new GUIContent("Number To Generate")); 58 | if (GUILayout.Button("Add Random Blocked Nodes")) 59 | pathfinding.addRandomBlockedNode = true; 60 | 61 | EditorGUILayout.PropertyField(manualBlockNode); 62 | 63 | if (GUILayout.Button("Add Manual Blocked Node")) 64 | pathfinding.addManualBlockedNode = true; 65 | 66 | serializedObject.ApplyModifiedProperties(); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Assets/Scripts/Editor/InitializePathfindingEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 652d7217651ec624ca63aed385f81a47 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/InitializePathfinding.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | using Unity.Transforms; 6 | using UnityEngine; 7 | using Random = UnityEngine.Random; 8 | 9 | namespace Pathfinding 10 | { 11 | public class InitializePathfinding : MonoBehaviour 12 | { 13 | //Options 14 | public int2 size; 15 | public bool showGrid; 16 | public bool showPaths; 17 | public bool canMoveDiag; 18 | public Color pathColor; 19 | 20 | //Manual Path 21 | [HideInInspector] public Vector2Int start; 22 | [HideInInspector] public Vector2Int end; 23 | [HideInInspector] public bool searchManualPath; 24 | 25 | 26 | //Random Path 27 | [HideInInspector] public int numOfRandomPaths; 28 | [HideInInspector] public bool searchRandomPaths; 29 | 30 | //Manual blocked 31 | List blockedNodes = new List(); 32 | [HideInInspector] public Vector2Int blockedNode; 33 | [HideInInspector] public bool addManualBlockedNode; 34 | 35 | //Random blocked 36 | [HideInInspector] public int numbOfRandomBlockedNodes = 1; 37 | [HideInInspector] public bool addRandomBlockedNode; 38 | 39 | int previousSize; // Prevent GUI Errors 40 | 41 | private void Awake() 42 | { 43 | World.Active.GetExistingSystem().canMoveDiag = canMoveDiag; 44 | CreateGrid(); 45 | } 46 | 47 | private void Update() 48 | { 49 | if(size.x * size.y != previousSize) 50 | { 51 | CreateGrid(); 52 | } 53 | 54 | if(addManualBlockedNode) 55 | { 56 | blockedNodes.Add(new int2(blockedNode.x, blockedNode.y)); 57 | addManualBlockedNode = false; 58 | CreateGrid(); 59 | } 60 | 61 | if(searchManualPath) 62 | { 63 | CreateSearcher(new int2(start.x, start.y), new int2(end.x, end.y)); 64 | searchManualPath = false; 65 | } 66 | 67 | if (addRandomBlockedNode) 68 | { 69 | addRandomBlockedNode = false; 70 | CreateBlockedNodes(); 71 | } 72 | 73 | if(searchRandomPaths) 74 | { 75 | searchRandomPaths = false; 76 | 77 | for (int i = 0; i < numOfRandomPaths; i++) 78 | { 79 | CreateSearcher(new int2(Random.Range(0, size.x), Random.Range(0, size.y)), new int2(Random.Range(0, size.x), Random.Range(0, size.y))); 80 | } 81 | } 82 | } 83 | 84 | public void CreateBlockedNodes() 85 | { 86 | EntityManager entityManager = World.Active.EntityManager; 87 | var cells = RequiredExtensions.cells; 88 | 89 | for (int i = 0; i < numbOfRandomBlockedNodes; i++) 90 | { 91 | int randomCell = Random.Range(0, size.x * size.y); 92 | 93 | cells[randomCell] = new Cell { blocked = Convert.ToByte(true), Height = 0 }; 94 | } 95 | } 96 | 97 | public void CreateSearcher(int2 s, int2 e) 98 | { 99 | EntityManager entityManager = World.Active.EntityManager; 100 | var pathSearcher = entityManager.CreateEntity(typeof(PathRequest), typeof(Translation), typeof(NavigationCapabilities)); 101 | var trans = entityManager.GetComponentData(pathSearcher); 102 | trans.Value = new float3(s.x, s.y, 0); 103 | entityManager.SetComponentData(pathSearcher, trans); 104 | 105 | entityManager.AddBuffer(pathSearcher); 106 | PathRequest pathRequest = new PathRequest 107 | { 108 | Entity = pathSearcher, 109 | start = s, 110 | end = e, 111 | Destination = NodeToWorldPosition(e), 112 | NavigateToBestIfIncomplete = true, 113 | NavigateToNearestIfBlocked = true 114 | }; 115 | 116 | entityManager.SetComponentData(pathSearcher, pathRequest); 117 | } 118 | 119 | private void OnDisable() 120 | { 121 | RequiredExtensions.cells.Dispose(); 122 | } 123 | 124 | public void CreateGrid() 125 | { 126 | if(RequiredExtensions.cells.IsCreated) 127 | RequiredExtensions.cells.Dispose(); 128 | RequiredExtensions.cells = new Unity.Collections.NativeArray(size.x * size.y, Unity.Collections.Allocator.Persistent); 129 | 130 | previousSize = size.x * size.y; 131 | 132 | for (int y = 0; y < size.y; y++) 133 | { 134 | for (int x = 0; x < size.x; x++) 135 | { 136 | Cell cell = new Cell 137 | { 138 | blocked = Convert.ToByte(blockedNodes.Contains(new int2(x, y))) 139 | }; 140 | RequiredExtensions.cells[GetIndex(new int2(x, y))] = cell; 141 | } 142 | } 143 | World.Active.GetExistingSystem().worldSize = size; 144 | } 145 | 146 | void OnDrawGizmos() 147 | { 148 | if (!showGrid && !showPaths) return; 149 | 150 | if (Application.isPlaying) 151 | { 152 | if (showGrid && size.x * size.y == previousSize) 153 | { 154 | var cells = RequiredExtensions.cells; 155 | 156 | for (int x = 0; x < size.x; x++) 157 | { 158 | for (int y = 0; y < size.y; y++) 159 | { 160 | Gizmos.color = cells[GetIndex(new int2(x, y))].Blocked ? Color.grey : Color.white; 161 | Gizmos.DrawCube(NodeToWorldPosition(new int2(x, y)), new Vector3(.90f, .90f)); 162 | } 163 | } 164 | } 165 | 166 | if (showPaths) 167 | { 168 | EntityManager entityManager = World.Active.EntityManager; 169 | var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly()); 170 | if (query.CalculateEntityCount() > 0) 171 | { 172 | var actualGroup = query.ToEntityArray(Unity.Collections.Allocator.TempJob); 173 | 174 | foreach (Entity entity in actualGroup) 175 | { 176 | var buffer = entityManager.GetBuffer(entity); 177 | 178 | if (buffer.Length > 0) 179 | { 180 | Gizmos.color = pathColor; 181 | 182 | for (int i = 0; i < buffer.Length - 1; i++) 183 | { 184 | Gizmos.DrawLine(buffer[i].waypoints - .5f, buffer[i + 1].waypoints - .5f); 185 | } 186 | } 187 | } 188 | actualGroup.Dispose(); 189 | } 190 | } 191 | } 192 | } 193 | 194 | public float3 NodeToWorldPosition(int2 i) => new float3(i.x, i.y, 0); 195 | 196 | int GetIndex(int2 i) 197 | { 198 | if (size.y >= size.x) 199 | return (i.x * size.y) + i.y; 200 | else 201 | return (i.y * size.x) + i.x; 202 | } 203 | } 204 | } -------------------------------------------------------------------------------- /Assets/Scripts/InitializePathfinding.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c17199525bd4ea1418796ce41745946d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/NativeMinHeap.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace Pathfinding 3 | { 4 | using System; 5 | using Unity.Collections; 6 | using Unity.Collections.LowLevel.Unsafe; 7 | using Unity.Mathematics; 8 | 9 | [NativeContainerSupportsDeallocateOnJobCompletion] 10 | [NativeContainer] 11 | public unsafe struct NativeMinHeap : IDisposable 12 | { 13 | private readonly Allocator allocator; 14 | 15 | [NativeDisableUnsafePtrRestriction] 16 | private void* buffer; 17 | 18 | private int capacity; 19 | 20 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 21 | private AtomicSafetyHandle m_Safety; 22 | 23 | [NativeSetClassTypeToNullOnSchedule] 24 | private DisposeSentinel m_DisposeSentinel; 25 | #endif 26 | 27 | private int head; 28 | 29 | private int length; 30 | 31 | /// 32 | /// Initializes a new instance of the struct. 33 | /// 34 | /// The capacity of the min heap. 35 | /// The allocator. 36 | /// Thrown if allocator not set, capacity is negative or the size > maximum integer value. 37 | public NativeMinHeap(int capacity, Allocator allocator) 38 | { 39 | var size = (long)UnsafeUtility.SizeOf() * capacity; 40 | if (allocator <= Allocator.None) 41 | { 42 | throw new ArgumentException("Allocator must be Temp, TempJob or Persistent", nameof(allocator)); 43 | } 44 | 45 | if (capacity < 0) 46 | { 47 | throw new ArgumentOutOfRangeException(nameof(capacity), "Length must be >= 0"); 48 | } 49 | 50 | if (size > int.MaxValue) 51 | { 52 | throw new ArgumentOutOfRangeException( 53 | nameof(capacity), 54 | $"Length * sizeof(T) cannot exceed {int.MaxValue} bytes"); 55 | } 56 | 57 | this.buffer = UnsafeUtility.Malloc(size, UnsafeUtility.AlignOf(), allocator); 58 | this.capacity = capacity; 59 | this.allocator = allocator; 60 | this.head = -1; 61 | this.length = 0; 62 | 63 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 64 | DisposeSentinel.Create(out this.m_Safety, out this.m_DisposeSentinel, 1, allocator); 65 | #endif 66 | } 67 | 68 | /// 69 | /// Does the heap still have remaining nodes. 70 | /// 71 | /// 72 | /// True if the min heap still has at least one remaining node, otherwise false. 73 | /// 74 | public bool HasNext() 75 | { 76 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 77 | AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety); 78 | #endif 79 | return this.head >= 0; 80 | } 81 | 82 | /// 83 | /// Add a node to the heap which will be sorted. 84 | /// 85 | /// The node to add. 86 | /// Throws if capacity reached. 87 | public void Push(MinHeapNode node) 88 | { 89 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 90 | if (this.length == this.capacity) 91 | { 92 | throw new IndexOutOfRangeException("Capacity Reached"); 93 | } 94 | 95 | AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety); 96 | #endif 97 | if (this.head < 0) 98 | { 99 | this.head = this.length; 100 | } 101 | else if (node.ExpectedCost < this.Get(this.head).ExpectedCost) 102 | { 103 | node.Next = this.head; 104 | this.head = this.length; 105 | } 106 | else 107 | { 108 | var currentPtr = this.head; 109 | var current = this.Get(currentPtr); 110 | 111 | while (current.Next >= 0 && this.Get(current.Next).ExpectedCost <= node.ExpectedCost) 112 | { 113 | currentPtr = current.Next; 114 | current = this.Get(current.Next); 115 | } 116 | 117 | node.Next = current.Next; 118 | current.Next = this.length; 119 | 120 | UnsafeUtility.WriteArrayElement(this.buffer, currentPtr, current); 121 | } 122 | 123 | UnsafeUtility.WriteArrayElement(this.buffer, this.length, node); 124 | this.length += 1; 125 | } 126 | 127 | /// 128 | /// Take the top node off the heap. 129 | /// 130 | /// The current node of the heap. 131 | public MinHeapNode Pop() 132 | { 133 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 134 | AtomicSafetyHandle.CheckWriteAndThrow(this.m_Safety); 135 | #endif 136 | var result = this.head; 137 | this.head = this.Get(this.head).Next; 138 | return this.Get(result); 139 | } 140 | 141 | /// 142 | /// Clear the heap by resetting the head and length. 143 | /// 144 | /// Does not clear memory. 145 | public void Clear() 146 | { 147 | this.head = -1; 148 | this.length = 0; 149 | } 150 | 151 | /// 152 | /// Dispose of the heap by freeing up memory. 153 | /// 154 | /// Memory hasn't been allocated. 155 | public void Dispose() 156 | { 157 | if (!UnsafeUtility.IsValidAllocator(this.allocator)) 158 | { 159 | return; 160 | } 161 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 162 | DisposeSentinel.Dispose(ref this.m_Safety, ref this.m_DisposeSentinel); 163 | #endif 164 | UnsafeUtility.Free(this.buffer, this.allocator); 165 | this.buffer = null; 166 | this.capacity = 0; 167 | } 168 | 169 | public NativeMinHeap Slice(int start, int length) 170 | { 171 | var stride = UnsafeUtility.SizeOf(); 172 | 173 | return new NativeMinHeap() 174 | { 175 | buffer = (byte*)((IntPtr)this.buffer + stride * start), 176 | capacity = length, 177 | length = 0, 178 | head = -1, 179 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 180 | m_Safety = this.m_Safety, 181 | #endif 182 | }; 183 | } 184 | 185 | private MinHeapNode Get(int index) 186 | { 187 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 188 | if (index < 0 || index >= this.length) 189 | { 190 | this.FailOutOfRangeError(index); 191 | } 192 | 193 | AtomicSafetyHandle.CheckReadAndThrow(this.m_Safety); 194 | #endif 195 | 196 | return UnsafeUtility.ReadArrayElement(this.buffer, index); 197 | } 198 | 199 | #if ENABLE_UNITY_COLLECTIONS_CHECKS 200 | private void FailOutOfRangeError(int index) 201 | { 202 | throw new IndexOutOfRangeException($"Index {index} is out of range of '{this.capacity}' Length."); 203 | } 204 | #endif 205 | } 206 | 207 | /// 208 | /// The min heap node. 209 | /// 210 | public struct MinHeapNode 211 | { 212 | /// 213 | /// Initializes a new instance of the struct. 214 | /// 215 | /// The position. 216 | /// The expected cost. 217 | /// Remaining distance to the goal 218 | public MinHeapNode(int2 position, float expectedCost, float distanceToGoal) 219 | { 220 | this.Position = position; 221 | this.ExpectedCost = expectedCost; 222 | this.DistanceToGoal = distanceToGoal; 223 | this.Next = -1; 224 | } 225 | 226 | /// 227 | /// Gets the position. 228 | /// 229 | public int2 Position { get; } 230 | 231 | /// 232 | /// Gets the expected cost. 233 | /// 234 | public float ExpectedCost { get; } 235 | 236 | /// 237 | /// Gets the expected cost. 238 | /// 239 | public float DistanceToGoal { get; } 240 | 241 | /// 242 | /// Gets or sets the next node in the heap. 243 | /// 244 | public int Next { get; set; } 245 | } 246 | } -------------------------------------------------------------------------------- /Assets/Scripts/NativeMinHeap.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60bcf159994e5dc44a42c028b9a0e107 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/PathfindingSystem.cs: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Jobs; 5 | using Unity.Mathematics; 6 | using Unity.Transforms; 7 | using UnityEngine; 8 | 9 | namespace Pathfinding 10 | { 11 | public class PathfindingSystem : JobComponentSystem 12 | { 13 | NativeArray neighbours; 14 | EntityQuery pathRequests; 15 | 16 | const int IterationLimit = 1000; 17 | public int2 worldSize; 18 | 19 | public bool canMoveDiag; 20 | 21 | protected override void OnCreate() 22 | { 23 | pathRequests = GetEntityQuery(typeof(Waypoint), ComponentType.ReadOnly(), ComponentType.ReadOnly(), ComponentType.ReadOnly()); 24 | pathRequests.SetFilterChanged(typeof(PathRequest)); 25 | 26 | if (canMoveDiag) 27 | { 28 | neighbours = new NativeArray(8, Allocator.Persistent) 29 | { 30 | [0] = new Neighbour(-1, -1), // Bottom left 31 | [1] = new Neighbour(0, -1), // Bottom 32 | [2] = new Neighbour(1, -1), // Bottom Right 33 | [3] = new Neighbour(-1, 0), // Left 34 | [4] = new Neighbour(1, 0), // Right 35 | [5] = new Neighbour(-1, 1), // Top Left 36 | [6] = new Neighbour(0, 1), // Top 37 | [7] = new Neighbour(1, 1), // Top Right 38 | }; 39 | } 40 | else 41 | { 42 | neighbours = new NativeArray(4, Allocator.Persistent) 43 | { 44 | [0] = new Neighbour(0, -1), // Bottom 45 | [1] = new Neighbour(-1, 0), // Left 46 | [2] = new Neighbour(1, 0), // Right 47 | [3] = new Neighbour(0, 1), // Top 48 | }; 49 | } 50 | } 51 | 52 | protected override void OnDestroy() 53 | { 54 | neighbours.Dispose(); 55 | } 56 | 57 | protected override JobHandle OnUpdate(JobHandle inputDeps) 58 | { 59 | int numberOfRequests = pathRequests.CalculateChunkCount(); 60 | if (numberOfRequests == 0) return inputDeps; 61 | 62 | //Schedule the findPath to build Job 63 | FindPathJobChunk findPathJob = new FindPathJobChunk() 64 | { 65 | WaypointChunkBuffer = GetArchetypeChunkBufferType(false), 66 | PathRequestsChunkComponent = GetArchetypeChunkComponentType(true), 67 | CellArray = RequiredExtensions.cells, 68 | TranslationsChunkComponent = GetArchetypeChunkComponentType(true), 69 | NavigationCapabilitiesChunkComponent = GetArchetypeChunkComponentType(true), 70 | Neighbors = neighbours, 71 | DimY = worldSize.y, 72 | DimX = worldSize.x, 73 | Iterations = IterationLimit, 74 | NeighborCount = neighbours.Length 75 | }; 76 | JobHandle jobHandle = findPathJob.Schedule(pathRequests, inputDeps); 77 | 78 | return jobHandle; 79 | } 80 | 81 | [BurstCompile] 82 | struct FindPathJobChunk : IJobChunk 83 | { 84 | [ReadOnly] public int DimX; 85 | [ReadOnly] public int DimY; 86 | [ReadOnly] public int Iterations; 87 | [ReadOnly] public int NeighborCount; 88 | [ReadOnly] public NativeArray CellArray; 89 | [WriteOnly] public ArchetypeChunkBufferType WaypointChunkBuffer; 90 | [ReadOnly] public ArchetypeChunkComponentType PathRequestsChunkComponent; 91 | [ReadOnly] public NativeArray Neighbors; 92 | [ReadOnly] public ArchetypeChunkComponentType TranslationsChunkComponent; 93 | [ReadOnly] public ArchetypeChunkComponentType NavigationCapabilitiesChunkComponent; 94 | 95 | public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex) 96 | { 97 | int size = DimX * DimY; 98 | BufferAccessor Waypoints = chunk.GetBufferAccessor(WaypointChunkBuffer); 99 | NativeArray PathRequests = chunk.GetNativeArray(PathRequestsChunkComponent); 100 | NativeArray Translations = chunk.GetNativeArray(TranslationsChunkComponent); 101 | NativeArray NavigationCapabilities = chunk.GetNativeArray(NavigationCapabilitiesChunkComponent); 102 | NativeArray CostSoFar = new NativeArray(size * chunk.Count, Allocator.Temp); 103 | NativeArray CameFrom = new NativeArray(size * chunk.Count, Allocator.Temp); 104 | NativeMinHeap OpenSet = new NativeMinHeap((Iterations + 1) * Neighbors.Length * chunk.Count, Allocator.Temp); 105 | 106 | for (int i = chunkIndex; i < chunk.Count; i++) 107 | { 108 | NativeSlice costSoFar = CostSoFar.Slice(i * size, size); 109 | NativeSlice cameFrom = CameFrom.Slice(i * size, size); 110 | 111 | int openSetSize = (Iterations + 1) * NeighborCount; 112 | NativeMinHeap openSet = OpenSet.Slice(i * openSetSize, openSetSize); 113 | PathRequest request = PathRequests[i]; 114 | 115 | Translation currentPosition = Translations[i]; 116 | NavigationCapabilities capability = NavigationCapabilities[i]; 117 | 118 | // cache these as they're used a lot 119 | int2 start = currentPosition.Value.xy.FloorToInt(); 120 | int2 goal = request.end; 121 | 122 | DynamicBuffer waypoints = Waypoints[i].Reinterpret(); 123 | waypoints.Clear(); 124 | 125 | // Special case when the start is the same point as the goal 126 | if (start.Equals(goal)) 127 | { 128 | // We just set the destination as the goal, but need to get the correct height 129 | int gridIndex = this.GetIndex(goal); 130 | Cell cell = CellArray[gridIndex]; 131 | float3 point = new float3(request.Destination.x, request.Destination.y, cell.Height); 132 | waypoints.Add(point); 133 | continue; 134 | } 135 | 136 | var stash = new InstanceStash 137 | { 138 | Grid = CellArray, 139 | CameFrom = cameFrom, 140 | CostSoFar = costSoFar, 141 | OpenSet = openSet, 142 | Request = request, 143 | Capability = capability, 144 | CurrentPosition = currentPosition, 145 | Start = start, 146 | Goal = goal, 147 | Waypoints = waypoints, 148 | }; 149 | 150 | if (this.ProcessPath(ref stash)) 151 | this.ReconstructPath(stash); 152 | } 153 | CostSoFar.Dispose(); 154 | CameFrom.Dispose(); 155 | OpenSet.Dispose(); 156 | } 157 | 158 | static float H(float2 p0, float2 p1) 159 | { 160 | float dx = p0.x - p1.x; 161 | float dy = p0.y - p1.y; 162 | float sqr = (dx * dx) + (dy * dy); 163 | return math.sqrt(sqr); 164 | } 165 | 166 | bool ProcessPath(ref InstanceStash stash) 167 | { 168 | // Push the start to NativeMinHeap openSet 169 | float hh = H(stash.Start, stash.Goal); 170 | MinHeapNode head = new MinHeapNode(stash.Start, hh, hh); 171 | stash.OpenSet.Push(head); 172 | 173 | int iterations = this.Iterations; 174 | 175 | MinHeapNode closest = head; 176 | 177 | // While we still have potential nodes to explore 178 | while (stash.OpenSet.HasNext()) 179 | { 180 | MinHeapNode current = stash.OpenSet.Pop(); 181 | 182 | if (current.DistanceToGoal < closest.DistanceToGoal) 183 | closest = current; 184 | // Found our goal 185 | if (current.Position.Equals(stash.Goal)) 186 | return true; 187 | 188 | // Path might still be obtainable but we've run out of allowed iterations 189 | if (iterations == 0) 190 | { 191 | if (stash.Request.NavigateToBestIfIncomplete) 192 | { 193 | // Return the best result we've found so far 194 | // Need to update goal so we can reconstruct the shorter path 195 | stash.Goal = closest.Position; 196 | return true; 197 | } 198 | return false; 199 | } 200 | iterations--; 201 | 202 | var initialCost = stash.CostSoFar[this.GetIndex(current.Position)]; 203 | var fromIndex = this.GetIndex(current.Position); 204 | 205 | // Loop our potential cells - generally neighbours but could include portals 206 | for (var i = 0; i < this.Neighbors.Length; i++) 207 | { 208 | var neighbour = this.Neighbors[i]; 209 | var position = current.Position + neighbour.Offset; 210 | 211 | // Make sure the node isn't outside our grid 212 | if (position.x < 0 || position.x >= this.DimX || position.y < 0 || position.y >= this.DimY) 213 | continue; 214 | 215 | var index = this.GetIndex(position); 216 | 217 | // Get the cost of going to this cell 218 | var cellCost = this.GetCellCost(stash.Grid, stash.Capability, fromIndex, index, neighbour, true); 219 | 220 | // Infinity means the cell is un-walkable, skip it 221 | if (float.IsInfinity(cellCost)) 222 | continue; 223 | 224 | var newCost = initialCost + (neighbour.Distance * cellCost); 225 | var oldCost = stash.CostSoFar[index]; 226 | 227 | // If we've explored this cell before and it was a better path, ignore this route 228 | if (!(oldCost <= 0) && !(newCost < oldCost)) 229 | continue; 230 | 231 | // Update the costing and best path 232 | stash.CostSoFar[index] = newCost; 233 | stash.CameFrom[index] = current.Position; 234 | 235 | // Push the node onto our heap 236 | var h = H(position, stash.Goal); 237 | var expectedCost = newCost + h; 238 | stash.OpenSet.Push(new MinHeapNode(position, expectedCost, h)); 239 | } 240 | } 241 | 242 | if (stash.Request.NavigateToNearestIfBlocked) 243 | { 244 | stash.Goal = closest.Position; 245 | return true; 246 | } 247 | 248 | // All routes have been explored without finding a route to destination 249 | return false; 250 | } 251 | 252 | void ReconstructPath(InstanceStash stash) 253 | { 254 | var current = stash.CameFrom[this.GetIndex(stash.Goal)]; 255 | 256 | var from = this.GetPosition(stash.Grid, current); 257 | 258 | stash.Waypoints.Add(from); 259 | 260 | var next = this.GetPosition(stash.Grid, current); 261 | 262 | while (!current.Equals(stash.Start)) 263 | { 264 | current = stash.CameFrom[this.GetIndex(current)]; 265 | var tmp = next; 266 | next = this.GetPosition(stash.Grid, current); 267 | 268 | if (!this.IsWalkable(stash.Grid, from.xy, next.xy)) 269 | { 270 | // skip 271 | stash.Waypoints.Add(tmp); 272 | from = tmp; 273 | } 274 | } 275 | 276 | stash.Waypoints.Reverse(); 277 | 278 | stash.Request.fufilled = true; 279 | } 280 | 281 | bool IsWalkable(NativeArray buffer, float2 from, float2 to) 282 | { 283 | const float step = 0.25f; 284 | 285 | var vector = to - from; 286 | var length = math.length(vector); 287 | var unit = vector / length; 288 | var iterations = length / step; 289 | var currentCell = buffer[this.GetIndex(from.FloorToInt())]; 290 | 291 | for (var i = 0; i < iterations; i++) 292 | { 293 | var point = (i * step * unit) + from; 294 | 295 | var index = this.GetIndex(point.FloorToInt()); 296 | var cell = buffer[index]; 297 | if (cell.Blocked) 298 | return false; 299 | 300 | if (cell.Height != currentCell.Height) 301 | return false; 302 | } 303 | return true; 304 | } 305 | 306 | float GetCellCost(NativeArray grid, NavigationCapabilities capabilities, int fromIndex, int toIndex, Neighbour neighbour, bool areNeighbours) 307 | { 308 | var target = grid[toIndex]; 309 | if (target.Blocked) 310 | return float.PositiveInfinity; 311 | 312 | // If we're not neighbours, then we're a portal and can just go straight there 313 | if (!areNeighbours) 314 | return 1; 315 | 316 | var from = grid[fromIndex]; 317 | 318 | var heightDiff = target.Height - from.Height; 319 | var absDiff = math.abs(heightDiff); 320 | 321 | // TODO Should precompute this 322 | var dropHeight = 0; 323 | var climbHeight = 0; 324 | 325 | if (heightDiff > 0) 326 | climbHeight = absDiff; 327 | else 328 | dropHeight = absDiff; 329 | 330 | var slope = math.degrees(math.atan(absDiff / neighbour.Distance)); 331 | 332 | // TODO End precompute 333 | if ((capabilities.MaxClimbHeight < climbHeight || capabilities.MaxDropHeight < dropHeight) && 334 | capabilities.MaxSlopeAngle < slope) 335 | return float.PositiveInfinity; 336 | 337 | return 1; 338 | } 339 | 340 | float3 GetPosition(NativeArray grid, int2 point) 341 | { 342 | var index = this.GetIndex(point); 343 | var cell = grid[index]; 344 | var fPoint = point + new float2(0.5f, 0.5f); 345 | return new float3(fPoint.x, fPoint.y, cell.Height); 346 | } 347 | 348 | int GetIndex(int2 i) 349 | { 350 | if (DimY >= DimX) 351 | return (i.x * DimY) + i.y; 352 | else 353 | return (i.y * DimX) + i.x; 354 | } 355 | 356 | struct InstanceStash 357 | { 358 | public Translation CurrentPosition; 359 | public PathRequest Request; 360 | public NavigationCapabilities Capability; 361 | public DynamicBuffer Waypoints; 362 | 363 | public int2 Start; 364 | public int2 Goal; 365 | 366 | public NativeArray Grid; 367 | 368 | public NativeSlice CostSoFar; 369 | public NativeSlice CameFrom; 370 | public NativeMinHeap OpenSet; 371 | } 372 | } 373 | } 374 | } -------------------------------------------------------------------------------- /Assets/Scripts/PathfindingSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76c099f1006df534186268d23a3682bc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/RequiredExtensions.cs: -------------------------------------------------------------------------------- 1 |  2 | using Unity.Collections; 3 | using Unity.Entities; 4 | using Unity.Mathematics; 5 | 6 | namespace Pathfinding 7 | { 8 | public static class RequiredExtensions 9 | { 10 | public static NativeArray cells; 11 | 12 | public static void Reverse(this DynamicBuffer buffer) 13 | where T : struct 14 | { 15 | var length = buffer.Length; 16 | var index1 = 0; 17 | 18 | for (var index2 = length - 1; index1 < index2; --index2) 19 | { 20 | var obj = buffer[index1]; 21 | buffer[index1] = buffer[index2]; 22 | buffer[index2] = obj; 23 | ++index1; 24 | } 25 | } 26 | 27 | public static int2 FloorToInt(this float2 f2) => (int2)math.floor(f2); 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /Assets/Scripts/RequiredExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67e32d5b068ce1a41839dc91235c893d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ECSPathfinding.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Omniaffix-Dave/Unity-2D-Pathfinding-Grid-ECS-Job/633f4f04355587cd7dcfcfc492b5149acdb5e2e9/ECSPathfinding.PNG -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "2.0.8", 6 | "com.unity.analytics": "3.3.2", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.entities": "0.1.1-preview", 9 | "com.unity.ext.nunit": "1.0.0", 10 | "com.unity.ide.rider": "1.0.8", 11 | "com.unity.ide.vscode": "1.0.7", 12 | "com.unity.multiplayer-hlapi": "1.0.2", 13 | "com.unity.package-manager-ui": "2.2.0", 14 | "com.unity.purchasing": "2.0.6", 15 | "com.unity.test-framework": "1.0.13", 16 | "com.unity.textmeshpro": "2.0.1", 17 | "com.unity.timeline": "1.1.0", 18 | "com.unity.ugui": "1.0.0", 19 | "com.unity.xr.legacyinputhelpers": "2.0.2", 20 | "com.unity.modules.ai": "1.0.0", 21 | "com.unity.modules.androidjni": "1.0.0", 22 | "com.unity.modules.animation": "1.0.0", 23 | "com.unity.modules.assetbundle": "1.0.0", 24 | "com.unity.modules.audio": "1.0.0", 25 | "com.unity.modules.cloth": "1.0.0", 26 | "com.unity.modules.director": "1.0.0", 27 | "com.unity.modules.imageconversion": "1.0.0", 28 | "com.unity.modules.imgui": "1.0.0", 29 | "com.unity.modules.jsonserialize": "1.0.0", 30 | "com.unity.modules.particlesystem": "1.0.0", 31 | "com.unity.modules.physics": "1.0.0", 32 | "com.unity.modules.physics2d": "1.0.0", 33 | "com.unity.modules.screencapture": "1.0.0", 34 | "com.unity.modules.terrain": "1.0.0", 35 | "com.unity.modules.terrainphysics": "1.0.0", 36 | "com.unity.modules.tilemap": "1.0.0", 37 | "com.unity.modules.ui": "1.0.0", 38 | "com.unity.modules.uielements": "1.0.0", 39 | "com.unity.modules.umbra": "1.0.0", 40 | "com.unity.modules.unityanalytics": "1.0.0", 41 | "com.unity.modules.unitywebrequest": "1.0.0", 42 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 43 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 44 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 45 | "com.unity.modules.unitywebrequestwww": "1.0.0", 46 | "com.unity.modules.vehicles": "1.0.0", 47 | "com.unity.modules.video": "1.0.0", 48 | "com.unity.modules.vr": "1.0.0", 49 | "com.unity.modules.wind": "1.0.0", 50 | "com.unity.modules.xr": "1.0.0" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /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 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /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: 13 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_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_DefaultMaxAngularSpeed: 50 36 | -------------------------------------------------------------------------------- /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 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /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: 8 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_ShowLightmapResolutionOverlay: 1 27 | -------------------------------------------------------------------------------- /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: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /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 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /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: 4 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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /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: 18 7 | productGUID: 839c0e88fd955624b897fcd7c22a70e4 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: Unity-2D-Pathfinding-Grid-ECS-Job 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 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_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | displayResolutionDialog: 0 56 | iosUseCustomAppBackgroundBehavior: 0 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 1 68 | androidUseSwappy: 0 69 | androidBlitType: 0 70 | defaultIsNativeResolution: 1 71 | macRetinaSupport: 1 72 | runInBackground: 0 73 | captureSingleScreen: 0 74 | muteOtherAudioSources: 0 75 | Prepare IOS For Recording: 0 76 | Force IOS Speakers When Recording: 0 77 | deferSystemGesturesMode: 0 78 | hideHomeButton: 0 79 | submitAnalytics: 1 80 | usePlayerLog: 1 81 | bakeCollisionMeshes: 0 82 | forceSingleInstance: 0 83 | useFlipModelSwapchain: 1 84 | resizableWindow: 0 85 | useMacAppStoreValidation: 0 86 | macAppStoreCategory: public.app-category.games 87 | gpuSkinning: 0 88 | graphicsJobs: 0 89 | xboxPIXTextureCapture: 0 90 | xboxEnableAvatar: 0 91 | xboxEnableKinect: 0 92 | xboxEnableKinectAutoTracking: 0 93 | xboxEnableFitness: 0 94 | visibleInBackground: 1 95 | allowFullscreenSwitch: 1 96 | graphicsJobMode: 0 97 | fullscreenMode: 1 98 | xboxSpeechDB: 0 99 | xboxEnableHeadOrientation: 0 100 | xboxEnableGuest: 0 101 | xboxEnablePIXSampling: 0 102 | metalFramebufferOnly: 0 103 | xboxOneResolution: 0 104 | xboxOneSResolution: 0 105 | xboxOneXResolution: 3 106 | xboxOneMonoLoggingLevel: 0 107 | xboxOneLoggingLevel: 1 108 | xboxOneDisableEsram: 0 109 | xboxOnePresentImmediateThreshold: 0 110 | switchQueueCommandMemory: 1048576 111 | switchQueueControlMemory: 16384 112 | switchQueueComputeMemory: 262144 113 | switchNVNShaderPoolsGranularity: 33554432 114 | switchNVNDefaultPoolsGranularity: 16777216 115 | switchNVNOtherPoolsGranularity: 16777216 116 | vulkanEnableSetSRGBWrite: 0 117 | m_SupportedAspectRatios: 118 | 4:3: 1 119 | 5:4: 1 120 | 16:10: 1 121 | 16:9: 1 122 | Others: 1 123 | bundleVersion: 1.0 124 | preloadedAssets: [] 125 | metroInputSource: 0 126 | wsaTransparentSwapchain: 0 127 | m_HolographicPauseOnTrackingLoss: 1 128 | xboxOneDisableKinectGpuReservation: 1 129 | xboxOneEnable7thCore: 1 130 | vrSettings: 131 | cardboard: 132 | depthFormat: 0 133 | enableTransitionView: 0 134 | daydream: 135 | depthFormat: 0 136 | useSustainedPerformanceMode: 0 137 | enableVideoLayer: 0 138 | useProtectedVideoMemory: 0 139 | minimumSupportedHeadTracking: 0 140 | maximumSupportedHeadTracking: 1 141 | hololens: 142 | depthFormat: 1 143 | depthBufferSharingEnabled: 1 144 | lumin: 145 | depthFormat: 0 146 | frameTiming: 2 147 | enableGLCache: 0 148 | glCacheMaxBlobSize: 524288 149 | glCacheMaxFileSize: 8388608 150 | oculus: 151 | sharedDepthBuffer: 1 152 | dashSupport: 1 153 | lowOverheadMode: 0 154 | enable360StereoCapture: 0 155 | isWsaHolographicRemotingEnabled: 0 156 | protectGraphicsMemory: 0 157 | enableFrameTimingStats: 0 158 | useHDRDisplay: 0 159 | m_ColorGamuts: 00000000 160 | targetPixelDensity: 30 161 | resolutionScalingMode: 0 162 | androidSupportedAspectRatio: 1 163 | androidMaxAspectRatio: 2.1 164 | applicationIdentifier: {} 165 | buildNumber: {} 166 | AndroidBundleVersionCode: 1 167 | AndroidMinSdkVersion: 16 168 | AndroidTargetSdkVersion: 0 169 | AndroidPreferredInstallLocation: 1 170 | aotOptions: 171 | stripEngineCode: 1 172 | iPhoneStrippingLevel: 0 173 | iPhoneScriptCallOptimization: 0 174 | ForceInternetPermission: 0 175 | ForceSDCardPermission: 0 176 | CreateWallpaper: 0 177 | APKExpansionFiles: 0 178 | keepLoadedShadersAlive: 0 179 | StripUnusedMeshComponents: 0 180 | VertexChannelCompressionMask: 4054 181 | iPhoneSdkVersion: 988 182 | iOSTargetOSVersionString: 9.0 183 | tvOSSdkVersion: 0 184 | tvOSRequireExtendedGameController: 0 185 | tvOSTargetOSVersionString: 9.0 186 | uIPrerenderedIcon: 0 187 | uIRequiresPersistentWiFi: 0 188 | uIRequiresFullScreen: 1 189 | uIStatusBarHidden: 1 190 | uIExitOnSuspend: 0 191 | uIStatusBarStyle: 0 192 | iPhoneSplashScreen: {fileID: 0} 193 | iPhoneHighResSplashScreen: {fileID: 0} 194 | iPhoneTallHighResSplashScreen: {fileID: 0} 195 | iPhone47inSplashScreen: {fileID: 0} 196 | iPhone55inPortraitSplashScreen: {fileID: 0} 197 | iPhone55inLandscapeSplashScreen: {fileID: 0} 198 | iPhone58inPortraitSplashScreen: {fileID: 0} 199 | iPhone58inLandscapeSplashScreen: {fileID: 0} 200 | iPadPortraitSplashScreen: {fileID: 0} 201 | iPadHighResPortraitSplashScreen: {fileID: 0} 202 | iPadLandscapeSplashScreen: {fileID: 0} 203 | iPadHighResLandscapeSplashScreen: {fileID: 0} 204 | iPhone65inPortraitSplashScreen: {fileID: 0} 205 | iPhone65inLandscapeSplashScreen: {fileID: 0} 206 | iPhone61inPortraitSplashScreen: {fileID: 0} 207 | iPhone61inLandscapeSplashScreen: {fileID: 0} 208 | appleTVSplashScreen: {fileID: 0} 209 | appleTVSplashScreen2x: {fileID: 0} 210 | tvOSSmallIconLayers: [] 211 | tvOSSmallIconLayers2x: [] 212 | tvOSLargeIconLayers: [] 213 | tvOSLargeIconLayers2x: [] 214 | tvOSTopShelfImageLayers: [] 215 | tvOSTopShelfImageLayers2x: [] 216 | tvOSTopShelfImageWideLayers: [] 217 | tvOSTopShelfImageWideLayers2x: [] 218 | iOSLaunchScreenType: 0 219 | iOSLaunchScreenPortrait: {fileID: 0} 220 | iOSLaunchScreenLandscape: {fileID: 0} 221 | iOSLaunchScreenBackgroundColor: 222 | serializedVersion: 2 223 | rgba: 0 224 | iOSLaunchScreenFillPct: 100 225 | iOSLaunchScreenSize: 100 226 | iOSLaunchScreenCustomXibPath: 227 | iOSLaunchScreeniPadType: 0 228 | iOSLaunchScreeniPadImage: {fileID: 0} 229 | iOSLaunchScreeniPadBackgroundColor: 230 | serializedVersion: 2 231 | rgba: 0 232 | iOSLaunchScreeniPadFillPct: 100 233 | iOSLaunchScreeniPadSize: 100 234 | iOSLaunchScreeniPadCustomXibPath: 235 | iOSUseLaunchScreenStoryboard: 0 236 | iOSLaunchScreenCustomStoryboardPath: 237 | iOSDeviceRequirements: [] 238 | iOSURLSchemes: [] 239 | iOSBackgroundModes: 0 240 | iOSMetalForceHardShadows: 0 241 | metalEditorSupport: 1 242 | metalAPIValidation: 1 243 | iOSRenderExtraFrameOnPause: 0 244 | appleDeveloperTeamID: 245 | iOSManualSigningProvisioningProfileID: 246 | tvOSManualSigningProvisioningProfileID: 247 | iOSManualSigningProvisioningProfileType: 0 248 | tvOSManualSigningProvisioningProfileType: 0 249 | appleEnableAutomaticSigning: 0 250 | iOSRequireARKit: 0 251 | iOSAutomaticallyDetectAndAddCapabilities: 1 252 | appleEnableProMotion: 0 253 | clonedFromGUID: 00000000000000000000000000000000 254 | templatePackageId: 255 | templateDefaultScene: 256 | AndroidTargetArchitectures: 1 257 | AndroidSplashScreenScale: 0 258 | androidSplashScreen: {fileID: 0} 259 | AndroidKeystoreName: 260 | AndroidKeyaliasName: 261 | AndroidBuildApkPerCpuArchitecture: 0 262 | AndroidTVCompatibility: 0 263 | AndroidIsGame: 1 264 | AndroidEnableTango: 0 265 | androidEnableBanner: 1 266 | androidUseLowAccuracyLocation: 0 267 | androidUseCustomKeystore: 0 268 | m_AndroidBanners: 269 | - width: 320 270 | height: 180 271 | banner: {fileID: 0} 272 | androidGamepadSupportLevel: 0 273 | AndroidValidateAppBundleSize: 1 274 | AndroidAppBundleSizeToValidate: 150 275 | resolutionDialogBanner: {fileID: 0} 276 | m_BuildTargetIcons: [] 277 | m_BuildTargetPlatformIcons: [] 278 | m_BuildTargetBatching: [] 279 | m_BuildTargetGraphicsAPIs: [] 280 | m_BuildTargetVRSettings: [] 281 | openGLRequireES31: 0 282 | openGLRequireES31AEP: 0 283 | openGLRequireES32: 0 284 | vuforiaEnabled: 0 285 | m_TemplateCustomTags: {} 286 | mobileMTRendering: 287 | Android: 1 288 | iPhone: 1 289 | tvOS: 1 290 | m_BuildTargetGroupLightmapEncodingQuality: [] 291 | m_BuildTargetGroupLightmapSettings: [] 292 | playModeTestRunnerEnabled: 0 293 | runPlayModeTestAsEditModeTest: 0 294 | actionOnDotNetUnhandledException: 1 295 | enableInternalProfiler: 0 296 | logObjCUncaughtExceptions: 1 297 | enableCrashReportAPI: 0 298 | cameraUsageDescription: 299 | locationUsageDescription: 300 | microphoneUsageDescription: 301 | switchNetLibKey: 302 | switchSocketMemoryPoolSize: 6144 303 | switchSocketAllocatorPoolSize: 128 304 | switchSocketConcurrencyLimit: 14 305 | switchScreenResolutionBehavior: 2 306 | switchUseCPUProfiler: 0 307 | switchApplicationID: 0x01004b9000490000 308 | switchNSODependencies: 309 | switchTitleNames_0: 310 | switchTitleNames_1: 311 | switchTitleNames_2: 312 | switchTitleNames_3: 313 | switchTitleNames_4: 314 | switchTitleNames_5: 315 | switchTitleNames_6: 316 | switchTitleNames_7: 317 | switchTitleNames_8: 318 | switchTitleNames_9: 319 | switchTitleNames_10: 320 | switchTitleNames_11: 321 | switchTitleNames_12: 322 | switchTitleNames_13: 323 | switchTitleNames_14: 324 | switchPublisherNames_0: 325 | switchPublisherNames_1: 326 | switchPublisherNames_2: 327 | switchPublisherNames_3: 328 | switchPublisherNames_4: 329 | switchPublisherNames_5: 330 | switchPublisherNames_6: 331 | switchPublisherNames_7: 332 | switchPublisherNames_8: 333 | switchPublisherNames_9: 334 | switchPublisherNames_10: 335 | switchPublisherNames_11: 336 | switchPublisherNames_12: 337 | switchPublisherNames_13: 338 | switchPublisherNames_14: 339 | switchIcons_0: {fileID: 0} 340 | switchIcons_1: {fileID: 0} 341 | switchIcons_2: {fileID: 0} 342 | switchIcons_3: {fileID: 0} 343 | switchIcons_4: {fileID: 0} 344 | switchIcons_5: {fileID: 0} 345 | switchIcons_6: {fileID: 0} 346 | switchIcons_7: {fileID: 0} 347 | switchIcons_8: {fileID: 0} 348 | switchIcons_9: {fileID: 0} 349 | switchIcons_10: {fileID: 0} 350 | switchIcons_11: {fileID: 0} 351 | switchIcons_12: {fileID: 0} 352 | switchIcons_13: {fileID: 0} 353 | switchIcons_14: {fileID: 0} 354 | switchSmallIcons_0: {fileID: 0} 355 | switchSmallIcons_1: {fileID: 0} 356 | switchSmallIcons_2: {fileID: 0} 357 | switchSmallIcons_3: {fileID: 0} 358 | switchSmallIcons_4: {fileID: 0} 359 | switchSmallIcons_5: {fileID: 0} 360 | switchSmallIcons_6: {fileID: 0} 361 | switchSmallIcons_7: {fileID: 0} 362 | switchSmallIcons_8: {fileID: 0} 363 | switchSmallIcons_9: {fileID: 0} 364 | switchSmallIcons_10: {fileID: 0} 365 | switchSmallIcons_11: {fileID: 0} 366 | switchSmallIcons_12: {fileID: 0} 367 | switchSmallIcons_13: {fileID: 0} 368 | switchSmallIcons_14: {fileID: 0} 369 | switchManualHTML: 370 | switchAccessibleURLs: 371 | switchLegalInformation: 372 | switchMainThreadStackSize: 1048576 373 | switchPresenceGroupId: 374 | switchLogoHandling: 0 375 | switchReleaseVersion: 0 376 | switchDisplayVersion: 1.0.0 377 | switchStartupUserAccount: 0 378 | switchTouchScreenUsage: 0 379 | switchSupportedLanguagesMask: 0 380 | switchLogoType: 0 381 | switchApplicationErrorCodeCategory: 382 | switchUserAccountSaveDataSize: 0 383 | switchUserAccountSaveDataJournalSize: 0 384 | switchApplicationAttribute: 0 385 | switchCardSpecSize: -1 386 | switchCardSpecClock: -1 387 | switchRatingsMask: 0 388 | switchRatingsInt_0: 0 389 | switchRatingsInt_1: 0 390 | switchRatingsInt_2: 0 391 | switchRatingsInt_3: 0 392 | switchRatingsInt_4: 0 393 | switchRatingsInt_5: 0 394 | switchRatingsInt_6: 0 395 | switchRatingsInt_7: 0 396 | switchRatingsInt_8: 0 397 | switchRatingsInt_9: 0 398 | switchRatingsInt_10: 0 399 | switchRatingsInt_11: 0 400 | switchLocalCommunicationIds_0: 401 | switchLocalCommunicationIds_1: 402 | switchLocalCommunicationIds_2: 403 | switchLocalCommunicationIds_3: 404 | switchLocalCommunicationIds_4: 405 | switchLocalCommunicationIds_5: 406 | switchLocalCommunicationIds_6: 407 | switchLocalCommunicationIds_7: 408 | switchParentalControl: 0 409 | switchAllowsScreenshot: 1 410 | switchAllowsVideoCapturing: 1 411 | switchAllowsRuntimeAddOnContentInstall: 0 412 | switchDataLossConfirmation: 0 413 | switchUserAccountLockEnabled: 0 414 | switchSystemResourceMemory: 16777216 415 | switchSupportedNpadStyles: 22 416 | switchNativeFsCacheSize: 32 417 | switchIsHoldTypeHorizontal: 0 418 | switchSupportedNpadCount: 8 419 | switchSocketConfigEnabled: 0 420 | switchTcpInitialSendBufferSize: 32 421 | switchTcpInitialReceiveBufferSize: 64 422 | switchTcpAutoSendBufferSizeMax: 256 423 | switchTcpAutoReceiveBufferSizeMax: 256 424 | switchUdpSendBufferSize: 9 425 | switchUdpReceiveBufferSize: 42 426 | switchSocketBufferEfficiency: 4 427 | switchSocketInitializeEnabled: 1 428 | switchNetworkInterfaceManagerInitializeEnabled: 1 429 | switchPlayerConnectionEnabled: 1 430 | ps4NPAgeRating: 12 431 | ps4NPTitleSecret: 432 | ps4NPTrophyPackPath: 433 | ps4ParentalLevel: 11 434 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 435 | ps4Category: 0 436 | ps4MasterVersion: 01.00 437 | ps4AppVersion: 01.00 438 | ps4AppType: 0 439 | ps4ParamSfxPath: 440 | ps4VideoOutPixelFormat: 0 441 | ps4VideoOutInitialWidth: 1920 442 | ps4VideoOutBaseModeInitialWidth: 1920 443 | ps4VideoOutReprojectionRate: 60 444 | ps4PronunciationXMLPath: 445 | ps4PronunciationSIGPath: 446 | ps4BackgroundImagePath: 447 | ps4StartupImagePath: 448 | ps4StartupImagesFolder: 449 | ps4IconImagesFolder: 450 | ps4SaveDataImagePath: 451 | ps4SdkOverride: 452 | ps4BGMPath: 453 | ps4ShareFilePath: 454 | ps4ShareOverlayImagePath: 455 | ps4PrivacyGuardImagePath: 456 | ps4NPtitleDatPath: 457 | ps4RemotePlayKeyAssignment: -1 458 | ps4RemotePlayKeyMappingDir: 459 | ps4PlayTogetherPlayerCount: 0 460 | ps4EnterButtonAssignment: 2 461 | ps4ApplicationParam1: 0 462 | ps4ApplicationParam2: 0 463 | ps4ApplicationParam3: 0 464 | ps4ApplicationParam4: 0 465 | ps4DownloadDataSize: 0 466 | ps4GarlicHeapSize: 2048 467 | ps4ProGarlicHeapSize: 2560 468 | playerPrefsMaxSize: 32768 469 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 470 | ps4pnSessions: 1 471 | ps4pnPresence: 1 472 | ps4pnFriends: 1 473 | ps4pnGameCustomData: 1 474 | playerPrefsSupport: 0 475 | enableApplicationExit: 0 476 | resetTempFolder: 1 477 | restrictedAudioUsageRights: 0 478 | ps4UseResolutionFallback: 0 479 | ps4ReprojectionSupport: 0 480 | ps4UseAudio3dBackend: 0 481 | ps4SocialScreenEnabled: 0 482 | ps4ScriptOptimizationLevel: 2 483 | ps4Audio3dVirtualSpeakerCount: 14 484 | ps4attribCpuUsage: 0 485 | ps4PatchPkgPath: 486 | ps4PatchLatestPkgPath: 487 | ps4PatchChangeinfoPath: 488 | ps4PatchDayOne: 0 489 | ps4attribUserManagement: 0 490 | ps4attribMoveSupport: 0 491 | ps4attrib3DSupport: 0 492 | ps4attribShareSupport: 0 493 | ps4attribExclusiveVR: 0 494 | ps4disableAutoHideSplash: 0 495 | ps4videoRecordingFeaturesUsed: 0 496 | ps4contentSearchFeaturesUsed: 0 497 | ps4attribEyeToEyeDistanceSettingVR: 0 498 | ps4IncludedModules: [] 499 | monoEnv: 500 | splashScreenBackgroundSourceLandscape: {fileID: 0} 501 | splashScreenBackgroundSourcePortrait: {fileID: 0} 502 | blurSplashScreenBackground: 1 503 | spritePackerPolicy: 504 | webGLMemorySize: 32 505 | webGLExceptionSupport: 1 506 | webGLNameFilesAsHashes: 0 507 | webGLDataCaching: 1 508 | webGLDebugSymbols: 0 509 | webGLEmscriptenArgs: 510 | webGLModulesDirectory: 511 | webGLTemplate: APPLICATION:Default 512 | webGLAnalyzeBuildSize: 0 513 | webGLUseEmbeddedResources: 0 514 | webGLCompressionFormat: 0 515 | webGLLinkerTarget: 1 516 | webGLThreadsSupport: 0 517 | webGLWasmStreaming: 0 518 | scriptingDefineSymbols: {} 519 | platformArchitecture: {} 520 | scriptingBackend: {} 521 | il2cppCompilerConfiguration: {} 522 | managedStrippingLevel: {} 523 | incrementalIl2cppBuild: {} 524 | allowUnsafeCode: 1 525 | additionalIl2CppArgs: 526 | scriptingRuntimeVersion: 1 527 | gcIncremental: 0 528 | gcWBarrierValidation: 0 529 | apiCompatibilityLevelPerPlatform: {} 530 | m_RenderingPath: 1 531 | m_MobileRenderingPath: 1 532 | metroPackageName: Unity-2D-Pathfinding-Grid-ECS-Job 533 | metroPackageVersion: 534 | metroCertificatePath: 535 | metroCertificatePassword: 536 | metroCertificateSubject: 537 | metroCertificateIssuer: 538 | metroCertificateNotAfter: 0000000000000000 539 | metroApplicationDescription: Unity-2D-Pathfinding-Grid-ECS-Job 540 | wsaImages: {} 541 | metroTileShortName: 542 | metroTileShowName: 0 543 | metroMediumTileShowName: 0 544 | metroLargeTileShowName: 0 545 | metroWideTileShowName: 0 546 | metroSupportStreamingInstall: 0 547 | metroLastRequiredScene: 0 548 | metroDefaultTileSize: 1 549 | metroTileForegroundText: 2 550 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 551 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 552 | a: 1} 553 | metroSplashScreenUseBackgroundColor: 0 554 | platformCapabilities: {} 555 | metroTargetDeviceFamilies: {} 556 | metroFTAName: 557 | metroFTAFileTypes: [] 558 | metroProtocolName: 559 | XboxOneProductId: 560 | XboxOneUpdateKey: 561 | XboxOneSandboxId: 562 | XboxOneContentId: 563 | XboxOneTitleId: 564 | XboxOneSCId: 565 | XboxOneGameOsOverridePath: 566 | XboxOnePackagingOverridePath: 567 | XboxOneAppManifestOverridePath: 568 | XboxOneVersion: 1.0.0.0 569 | XboxOnePackageEncryption: 0 570 | XboxOnePackageUpdateGranularity: 2 571 | XboxOneDescription: 572 | XboxOneLanguage: 573 | - enus 574 | XboxOneCapability: [] 575 | XboxOneGameRating: {} 576 | XboxOneIsContentPackage: 0 577 | XboxOneEnableGPUVariability: 1 578 | XboxOneSockets: {} 579 | XboxOneSplashScreen: {fileID: 0} 580 | XboxOneAllowedProductIds: [] 581 | XboxOnePersistentLocalStorageSize: 0 582 | XboxOneXTitleMemory: 8 583 | xboxOneScriptCompiler: 1 584 | XboxOneOverrideIdentityName: 585 | vrEditorSettings: 586 | daydream: 587 | daydreamIconForeground: {fileID: 0} 588 | daydreamIconBackground: {fileID: 0} 589 | cloudServicesEnabled: {} 590 | luminIcon: 591 | m_Name: 592 | m_ModelFolderPath: 593 | m_PortalFolderPath: 594 | luminCert: 595 | m_CertPath: 596 | m_SignPackage: 1 597 | luminIsChannelApp: 0 598 | luminVersion: 599 | m_VersionCode: 1 600 | m_VersionName: 601 | facebookSdkVersion: 602 | facebookAppId: 603 | facebookCookies: 1 604 | facebookLogging: 1 605 | facebookStatus: 1 606 | facebookXfbml: 0 607 | facebookFrictionlessRequests: 1 608 | apiCompatibilityLevel: 6 609 | cloudProjectId: 610 | framebufferDepthMemorylessMode: 0 611 | projectName: 612 | organizationId: 613 | cloudEnabled: 0 614 | enableNativePlatformBackendsForNewInputSystem: 0 615 | disableOldInputManagerSupport: 0 616 | legacyClampBlendShapeWeights: 0 617 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.2.0f1 2 | m_EditorVersionWithRevision: 2019.2.0f1 (20c1667945cf) 3 | -------------------------------------------------------------------------------- /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: Very Low 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 | shadowmaskMode: 0 21 | skinWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | skinWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | skinWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | skinWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | skinWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | skinWeights: 255 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | BJM: 5 222 | Lumin: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | Standalone: 5 226 | WebGL: 3 227 | Windows Store Apps: 5 228 | XboxOne: 5 229 | iPhone: 2 230 | tvOS: 2 231 | -------------------------------------------------------------------------------- /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 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pure ECS Burst Job 2D Grid A* Pathfinding 2 | 3 | ![Image of 100 Searches](https://github.com/Omniaffix-Dave/Unity-2D-Pathfinding-Grid-ECS-Job/blob/master/ECSPathfinding.PNG) 4 | 5 | My goal was to create an easy to use high performant example for myself, as well as other people to incorporate into their 2D projects. 6 | 7 | [Forum discussion post](https://forum.unity.com/threads/planning-a-2d-grid-pure-ecs-job-burst-pathfinding.724211) 8 | 9 | ## Why Pure ECS? 10 | The current project I was working on had performance issues, I resolved some by converting my targeting system to pure ECS. 11 | After I made this change I couldn't believe how amazing the performance was, so I wanted to push things to the limit. 12 | My previous pathfinding system was the cause for +70% of the CPU strain, so I was bottlenecked by having too many Agents or too large a Map. 13 | 14 | ## Why Not use Navmesh? 15 | Unity has not shown any love to 2D in the form of navigation, and until that changes I would rather use something that I can quickly adjust 16 | at runtime without having to do work-arounds or hacks to make compatible. 17 | There are other resources for doing so here: [NavMesh+](https://unitylist.com/p/hqq/Nav-Mesh-Plus) 18 | --------------------------------------------------------------------------------