├── .gitignore ├── Assets ├── Plugins.meta ├── Plugins │ ├── Collisions.meta │ ├── Collisions │ │ ├── DebugHelpers.meta │ │ ├── DebugHelpers │ │ │ ├── CollisionTester.cs │ │ │ ├── CollisionTester.cs.meta │ │ │ ├── DebugGameObject.cs │ │ │ ├── DebugGameObject.cs.meta │ │ │ ├── DrawingHelpers.cs │ │ │ └── DrawingHelpers.cs.meta │ │ ├── SimpleBurstCollision.meta │ │ └── SimpleBurstCollision │ │ │ ├── BurstBaseCollider.cs │ │ │ ├── BurstBaseCollider.cs.meta │ │ │ ├── BurstBoxCollider.cs │ │ │ ├── BurstBoxCollider.cs.meta │ │ │ ├── BurstColliderFactory.cs │ │ │ ├── BurstColliderFactory.cs.meta │ │ │ ├── BurstSphereCollider.cs │ │ │ ├── BurstSphereCollider.cs.meta │ │ │ ├── IBurstCollider.cs │ │ │ ├── IBurstCollider.cs.meta │ │ │ ├── IntersectionJobs.cs │ │ │ ├── IntersectionJobs.cs.meta │ │ │ ├── IntersectionUtility.cs │ │ │ └── IntersectionUtility.cs.meta │ ├── DebugDrawingExtension.meta │ ├── DebugDrawingExtension │ │ ├── DebugExtension.cs │ │ ├── DebugExtension.cs.meta │ │ ├── readme.txt │ │ └── readme.txt.meta │ ├── Math3D.cs │ ├── Math3D.cs.meta │ ├── NavMeshComponents.meta │ ├── NavMeshComponents │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── NavMeshAssetManager.cs │ │ │ ├── NavMeshAssetManager.cs.meta │ │ │ ├── NavMeshComponentsEditor.asmdef │ │ │ ├── NavMeshComponentsEditor.asmdef.meta │ │ │ ├── NavMeshComponentsGUIUtility.cs │ │ │ ├── NavMeshComponentsGUIUtility.cs.meta │ │ │ ├── NavMeshLinkEditor.cs │ │ │ ├── NavMeshLinkEditor.cs.meta │ │ │ ├── NavMeshModifierEditor.cs │ │ │ ├── NavMeshModifierEditor.cs.meta │ │ │ ├── NavMeshModifierVolumeEditor.cs │ │ │ ├── NavMeshModifierVolumeEditor.cs.meta │ │ │ ├── NavMeshSurfaceEditor.cs │ │ │ └── NavMeshSurfaceEditor.cs.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── NavMeshComponents.asmdef │ │ │ ├── NavMeshComponents.asmdef.meta │ │ │ ├── NavMeshLink.cs │ │ │ ├── NavMeshLink.cs.meta │ │ │ ├── NavMeshModifier.cs │ │ │ ├── NavMeshModifier.cs.meta │ │ │ ├── NavMeshModifierVolume.cs │ │ │ ├── NavMeshModifierVolume.cs.meta │ │ │ ├── NavMeshSurface.cs │ │ │ └── NavMeshSurface.cs.meta │ ├── Navigation.meta │ └── Navigation │ │ ├── BurstAStarPathFinder.cs │ │ ├── BurstAStarPathFinder.cs.meta │ │ ├── Grid.meta │ │ ├── Grid │ │ ├── GridBase.cs │ │ ├── GridBase.cs.meta │ │ ├── GridNode.cs │ │ ├── GridNode.cs.meta │ │ ├── GridPoint.cs │ │ ├── GridPoint.cs.meta │ │ ├── NavigationGrid.cs │ │ ├── NavigationGrid.cs.meta │ │ ├── NodeFlags.cs │ │ └── NodeFlags.cs.meta │ │ ├── Helpers.meta │ │ └── Helpers │ │ ├── Algorithms.meta │ │ ├── Algorithms │ │ ├── Bresenham.cs │ │ └── Bresenham.cs.meta │ │ ├── AreaDefinitions.cs │ │ ├── AreaDefinitions.cs.meta │ │ ├── Collections.meta │ │ ├── Collections │ │ ├── IndexedList.cs │ │ ├── IndexedList.cs.meta │ │ ├── NativeArray2D.cs │ │ ├── NativeArray2D.cs.meta │ │ ├── NativeArray3D.cs │ │ ├── NativeArray3D.cs.meta │ │ ├── NativeIndexList.cs │ │ ├── NativeIndexList.cs.meta │ │ ├── NativePriorityQueue.cs │ │ ├── NativePriorityQueue.cs.meta │ │ ├── SplitArray.cs │ │ └── SplitArray.cs.meta │ │ ├── Extensions.meta │ │ ├── Extensions │ │ ├── NativeArrayExtensions.cs │ │ └── NativeArrayExtensions.cs.meta │ │ ├── SimpleBounds.cs │ │ ├── SimpleBounds.cs.meta │ │ ├── SimpleTransform.cs │ │ ├── SimpleTransform.cs.meta │ │ ├── UnityColors.cs │ │ └── UnityColors.cs.meta ├── Prefabs.meta ├── Prefabs │ ├── CSGLevel.fbx │ ├── CSGLevel.fbx.meta │ ├── CSGLevel.prefab │ ├── CSGLevel.prefab.meta │ ├── Materials.meta │ └── Materials │ │ ├── Floor.mat │ │ ├── Floor.mat.meta │ │ ├── Obstacle.mat │ │ ├── Obstacle.mat.meta │ │ ├── PathEndMaterial.mat │ │ ├── PathEndMaterial.mat.meta │ │ ├── PathLineA.mat │ │ ├── PathLineA.mat.meta │ │ ├── PathStartMaterial.mat │ │ ├── PathStartMaterial.mat.meta │ │ ├── Textures.meta │ │ ├── Textures │ │ ├── Floor.png │ │ ├── Floor.png.meta │ │ ├── Wall.png │ │ ├── Wall.png.meta │ │ ├── Window.png │ │ ├── Window.png.meta │ │ ├── roughess.png │ │ └── roughess.png.meta │ │ ├── Wall.mat │ │ ├── Wall.mat.meta │ │ ├── Window.mat │ │ └── Window.mat.meta ├── Scenes.meta ├── Scenes │ ├── NavMeshLevel 1.meta │ ├── NavMeshLevel 1.unity │ ├── NavMeshLevel 1.unity.meta │ └── NavMeshLevel 1 │ │ ├── NavMesh-NavMesh.asset │ │ └── NavMesh-NavMesh.asset.meta ├── Scripts.meta └── Scripts │ ├── GridManager.cs │ ├── GridManager.cs.meta │ ├── GridNodeJobs.cs │ ├── GridNodeJobs.cs.meta │ ├── GridVolumeModifier.cs │ ├── GridVolumeModifier.cs.meta │ ├── NavMeshExtensions.cs │ ├── NavMeshExtensions.cs.meta │ ├── PathTester.cs │ ├── PathTester.cs.meta │ ├── Utilities.meta │ └── Utilities │ ├── Bool.cs │ ├── Bool.cs.meta │ ├── DrawBoundsGizmo.cs │ ├── DrawBoundsGizmo.cs.meta │ ├── Math3D.cs │ ├── Math3D.cs.meta │ ├── NavMeshAreasGenerator.cs │ ├── NavMeshAreasGenerator.cs.meta │ ├── RotateAround.cs │ └── RotateAround.cs.meta ├── LICENSE ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProBuilderSettings.json ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | Assets/AssetStoreTools* 7 | 8 | # Visual Studio cache directory 9 | .vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | *.opendb 26 | 27 | # Unity3D generated meta files 28 | *.pidb.meta 29 | *.pdb.meta 30 | 31 | # Unity3D Generated File On Crash Reports 32 | sysinfo.txt 33 | 34 | # Builds 35 | *.apk 36 | *.unitypackage 37 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca1b91d2a30ed734ca33b7eed84e3604 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f054a48e0324454cb3b4e1e1502a3db 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f74742e2c8f4ad4b8013acda2adbe88 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/CollisionTester.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Runtime.CompilerServices; 6 | using Unity.Collections; 7 | using Unity.Collections.LowLevel.Unsafe; 8 | using UnityEngine; 9 | using UnityEngine.Tilemaps; 10 | using Vella.SimpleBurstCollision; 11 | using Debug = UnityEngine.Debug; 12 | using Random = UnityEngine.Random; 13 | 14 | public class CollisionTester : MonoBehaviour 15 | { 16 | public List SourceObjects; 17 | private readonly Dictionary _trackedObjects = new Dictionary(); 18 | private Stopwatch _stopwatch = new Stopwatch(); 19 | private List _timings = new List(); 20 | 21 | //private NativeArray _bulkColliders; 22 | 23 | void OnEnable() 24 | { 25 | //_bulkColliders = new NativeArray(10000, Allocator.Persistent); 26 | 27 | //for (int i = 0; i < _bulkColliders.Length; i++) 28 | //{ 29 | // _bulkColliders[i] = i % 2 == 0 ? CreateRandomBox().ToBaseCollider() : CreateRandomSphere().ToBaseCollider(); 30 | //} 31 | } 32 | 33 | void OnDestroy() 34 | { 35 | //_bulkColliders.Dispose(); 36 | } 37 | 38 | private DateTime _lastUpdateTime = DateTime.MinValue; 39 | 40 | void Update() 41 | { 42 | if (DateTime.UtcNow.Subtract(_lastUpdateTime).TotalMilliseconds < 250) 43 | return; 44 | 45 | _lastUpdateTime = DateTime.UtcNow; 46 | 47 | UpdateCollection(SourceObjects); 48 | 49 | foreach (var item in _trackedObjects) 50 | { 51 | item.Value.IsColliding = false; 52 | item.Value.BurstCollider.Update(item.Value.Collider); 53 | } 54 | 55 | _timings.Clear(); 56 | 57 | foreach (var item in _trackedObjects) 58 | { 59 | var others = _trackedObjects.Where(kvp => kvp.Key != item.Key).Select(kvp => kvp.Value.BurstCollider).ToArray(); 60 | 61 | _stopwatch.Restart(); 62 | using (var intersections = item.Value.BurstCollider.Intersects(others)) 63 | { 64 | for (int i = 0; i < intersections.Length; i++) 65 | { 66 | _trackedObjects[intersections[i].Id].IsColliding = true; 67 | } 68 | } 69 | _stopwatch.Stop(); 70 | _timings.Add(_stopwatch.Elapsed); 71 | } 72 | 73 | Debug.Log($"{_timings.Count} Intersection jobs ({((_trackedObjects.Count-1)*(_trackedObjects.Count-1))}) took on average {_timings.Average(t => t.TotalMilliseconds):N4} ms ({_timings.Sum(t => t.TotalMilliseconds):N2} ms total)"); 74 | } 75 | 76 | private void UpdateCollection(IEnumerable source, bool pruneToSource = false) 77 | { 78 | var seenKeys = new HashSet(_trackedObjects.Keys); 79 | foreach (var go in source) 80 | { 81 | if (go == null) 82 | { 83 | continue; 84 | } 85 | var key = go.GetInstanceID(); 86 | if (!_trackedObjects.ContainsKey(key)) 87 | { 88 | _trackedObjects.Add(key, new DebugGameObject(go)); 89 | } 90 | seenKeys.Remove(key); 91 | } 92 | if (pruneToSource) 93 | { 94 | foreach (var key in seenKeys) 95 | { 96 | _trackedObjects.Remove(key); 97 | } 98 | } 99 | else 100 | { 101 | foreach (var item in _trackedObjects.ToList()) 102 | { 103 | if (item.Value == null) 104 | { 105 | _trackedObjects.Remove(item.Key); 106 | } 107 | } 108 | } 109 | } 110 | 111 | void OnDrawGizmos() 112 | { 113 | foreach (var item in _trackedObjects) 114 | { 115 | var box = BurstColliderFactory.CreateBox(item.Value.WrappedObject.transform); 116 | DrawingHelpers.DrawWireFrame(box); 117 | } 118 | } 119 | 120 | public static BurstSphereCollider CreateRandomSphere() 121 | { 122 | var x = BurstColliderFactory.CreateSphere(Random.insideUnitSphere * 2, Random.value); 123 | return x; 124 | } 125 | 126 | public static BurstBoxCollider CreateRandomBox() 127 | { 128 | var randomPosition = new Vector3(Random.value, Random.value, Random.value); 129 | var x = BurstColliderFactory.CreateBox(Random.insideUnitSphere * 4, randomPosition, Random.rotation); 130 | return x; 131 | } 132 | 133 | } -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/CollisionTester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0fc61f3330936a14990ac79492a88229 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/DebugGameObject.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | using Vella.SimpleBurstCollision; 4 | 5 | public class DebugGameObject 6 | { 7 | public GameObject WrappedObject; 8 | public Collider Collider; 9 | public BurstBaseCollider BurstCollider; 10 | 11 | private bool _isColliding; 12 | private readonly Renderer _renderer; 13 | private readonly Color _normalColor = Color.white; 14 | private readonly Color _intersectColor = Color.blue; 15 | 16 | public bool IsColliding 17 | { 18 | get => _isColliding; 19 | set 20 | { 21 | if (_isColliding != value) 22 | { 23 | _renderer.sharedMaterial.color = value ? _intersectColor : _normalColor; 24 | } 25 | _isColliding = value; 26 | } 27 | } 28 | public DebugGameObject(GameObject go) 29 | { 30 | WrappedObject = go; 31 | Collider = go.GetComponent(); 32 | _renderer = go.GetComponent(); 33 | _renderer.sharedMaterial = new Material(Shader.Find("Standard")); 34 | BurstCollider = new BurstBaseCollider(Collider); 35 | } 36 | 37 | public DebugGameObject(BurstSphereCollider sphere) 38 | { 39 | var go = GameObject.CreatePrimitive(PrimitiveType.Sphere); 40 | DuplicateAndScaleMesh(go, sphere.Radius*2); 41 | go.transform.position = sphere.Center; 42 | var collider = go.AddComponent(); 43 | collider.radius = sphere.Radius; 44 | Collider = collider; 45 | _renderer = go.GetComponent(); 46 | _renderer.sharedMaterial = new Material(Shader.Find("Standard")); 47 | BurstCollider = sphere.ToBaseCollider(go.GetInstanceID()); 48 | WrappedObject = go; 49 | } 50 | 51 | public void DuplicateAndScaleMesh(GameObject go, float scale) 52 | { 53 | var mf = go.GetComponent(); 54 | var originalMesh = mf?.sharedMesh; 55 | if (originalMesh == null) 56 | return; 57 | 58 | var newMesh = new Mesh(); 59 | var vertices = new Vector3[originalMesh.vertices.Length]; 60 | for (var i = 0; i < vertices.Length; i++) 61 | { 62 | var vertex = originalMesh.vertices[i]; 63 | vertex.x = vertex.x * scale; 64 | vertex.y = vertex.y * scale; 65 | vertex.z = vertex.z * scale; 66 | vertices[i] = vertex; 67 | } 68 | newMesh.SetVertices(vertices.ToList()); 69 | newMesh.SetTriangles(originalMesh.GetTriangles(0),0); 70 | newMesh.SetNormals(originalMesh.normals.ToList()); 71 | newMesh.RecalculateBounds(); 72 | mf.sharedMesh = newMesh; 73 | } 74 | 75 | public override string ToString() => $"[{WrappedObject.name}] BurstBaseCollider={BurstCollider}"; 76 | } 77 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/DebugGameObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 438e2f5d6230b664a92cecf0d1fc0c43 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/DrawingHelpers.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Vella.SimpleBurstCollision; 3 | 4 | public static class DrawingHelpers 5 | { 6 | public static void DrawVector(Vector3 origin, Vector3 vector, float size = 0.02f) 7 | { 8 | var halfSize = size * 0.5f; 9 | var end = origin + vector; 10 | Gizmos.DrawLine(origin, end); 11 | Gizmos.DrawSphere(origin, size); 12 | 13 | var arrowOffset = end - vector.normalized * size; 14 | var up = Vector3.Cross(vector, Vector3.up) * size; 15 | var down = Vector3.Cross(vector, Vector3.down) * size; 16 | var left = Vector3.Cross(vector, Vector3.left) * size; 17 | var right = Vector3.Cross(vector, Vector3.right) * size; 18 | 19 | var a1 = arrowOffset + up; 20 | var a2 = arrowOffset + up + Vector3.Cross(vector, Vector3.left) * halfSize; 21 | var a3 = arrowOffset + up + Vector3.Cross(vector, Vector3.right) * halfSize; 22 | var a4 = arrowOffset + down; 23 | var a5 = arrowOffset + down + Vector3.Cross(vector, Vector3.left) * halfSize; 24 | var a6 = arrowOffset + down + Vector3.Cross(vector, Vector3.right) * halfSize; 25 | var a7 = arrowOffset + left; 26 | var a8 = arrowOffset + right; 27 | 28 | Gizmos.DrawLine(end, a2); 29 | Gizmos.DrawLine(end, a3); 30 | Gizmos.DrawLine(end, a5); 31 | Gizmos.DrawLine(end, a6); 32 | Gizmos.DrawLine(end, a7); 33 | Gizmos.DrawLine(end, a8); 34 | 35 | Gizmos.DrawLine(a1, a2); 36 | Gizmos.DrawLine(a1, a3); 37 | Gizmos.DrawLine(a4, a5); 38 | Gizmos.DrawLine(a4, a6); 39 | Gizmos.DrawLine(a8, a6); 40 | Gizmos.DrawLine(a8, a3); 41 | Gizmos.DrawLine(a7, a2); 42 | Gizmos.DrawLine(a7, a5); 43 | 44 | } 45 | 46 | public static void DrawWireFrame(BurstBoxCollider obb) 47 | { 48 | Gizmos.DrawLine(obb.V1, obb.V3); 49 | Gizmos.DrawLine(obb.V1, obb.V2); 50 | Gizmos.DrawLine(obb.V3, obb.V4); 51 | Gizmos.DrawLine(obb.V2, obb.V4); 52 | Gizmos.DrawLine(obb.V1, obb.V5); 53 | Gizmos.DrawLine(obb.V2, obb.V6); 54 | Gizmos.DrawLine(obb.V3, obb.V7); 55 | Gizmos.DrawLine(obb.V4, obb.V8); 56 | Gizmos.DrawLine(obb.V5, obb.V7); 57 | Gizmos.DrawLine(obb.V5, obb.V6); 58 | Gizmos.DrawLine(obb.V7, obb.V8); 59 | Gizmos.DrawLine(obb.V8, obb.V6); 60 | } 61 | } -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/DebugHelpers/DrawingHelpers.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47ab51bd1cfe3c0478d1e331ab3ad6dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b31c355741d41e4795164a132129fa0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstBaseCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.CodeDom; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using Unity.Collections; 7 | using Unity.Mathematics; 8 | using UnityEngine; 9 | 10 | namespace Vella.SimpleBurstCollision 11 | { 12 | public enum BurstColliderType 13 | { 14 | None = 0, 15 | Sphere, 16 | Box, 17 | } 18 | 19 | public struct BurstBaseCollider : IBurstCollider 20 | { 21 | public BurstColliderType Type; 22 | public BurstSphereCollider Sphere; 23 | public BurstBoxCollider Box; 24 | public int Id; 25 | 26 | public BurstBaseCollider(Collider collider) 27 | { 28 | this = BurstColliderFactory.CreateFromCollider(collider); 29 | } 30 | 31 | public void Update(Collider collider) 32 | { 33 | if (collider is SphereCollider sphere) 34 | Sphere = BurstColliderFactory.CreateSphere(sphere); 35 | 36 | if (collider is BoxCollider box) 37 | Box = BurstColliderFactory.CreateBox(box); 38 | } 39 | 40 | public static readonly BurstBaseCollider Empty = new BurstBaseCollider(); 41 | 42 | } 43 | 44 | public static class BurstBaseColliderExtensions 45 | { 46 | 47 | public static NativeList Intersects(this BurstBaseCollider testCollider, BurstBaseCollider[] colliders) 48 | { 49 | return IntersectionJobs.BaseIntersectionJob.Execute(testCollider, colliders); 50 | } 51 | 52 | public static NativeList Intersects(this BurstBaseCollider testCollider, NativeArray colliders) 53 | { 54 | return IntersectionJobs.BaseIntersectionJob.Execute(testCollider, colliders); 55 | } 56 | 57 | public static bool Intersects(this BurstBaseCollider testCollider, BurstBaseCollider other) 58 | { 59 | switch (testCollider.Type) 60 | { 61 | case BurstColliderType.Box: 62 | switch (other.Type) 63 | { 64 | case BurstColliderType.Box: 65 | return IntersectionUtility.BoxBoxIntersects(testCollider.Box, other.Box); 66 | case BurstColliderType.Sphere: 67 | return IntersectionUtility.BoxSphereIntersects(testCollider.Box, other.Sphere); 68 | default: 69 | throw new InvalidOperationException(); 70 | } 71 | case BurstColliderType.Sphere: 72 | switch (other.Type) 73 | { 74 | case BurstColliderType.Box: 75 | return IntersectionUtility.BoxSphereIntersects(other.Box, testCollider.Sphere); 76 | case BurstColliderType.Sphere: 77 | return IntersectionUtility.SphereSphereIntersects(testCollider.Sphere, other.Sphere); 78 | default: 79 | throw new InvalidOperationException(); 80 | } 81 | } 82 | throw new InvalidOperationException(); 83 | } 84 | 85 | public static Vector3 ClosestPosition(this BurstBaseCollider baseCollider, Vector3 worldPosition) 86 | { 87 | switch (baseCollider.Type) 88 | { 89 | case BurstColliderType.Box: 90 | return baseCollider.Box.ClosestPosition(worldPosition); 91 | case BurstColliderType.Sphere: 92 | return baseCollider.Sphere.ClosestPosition(worldPosition); 93 | default: 94 | throw new InvalidOperationException(); 95 | } 96 | } 97 | 98 | public static bool Contains(this BurstBaseCollider baseCollider, Vector3 worldPosition) 99 | { 100 | switch (baseCollider.Type) 101 | { 102 | case BurstColliderType.Box: 103 | return baseCollider.Box.Contains(worldPosition); 104 | case BurstColliderType.Sphere: 105 | return baseCollider.Sphere.Contains(worldPosition); 106 | default: 107 | throw new InvalidOperationException(); 108 | } 109 | } 110 | 111 | public static BurstBaseCollider ToBurstCollider(this Collider collider) 112 | { 113 | return new BurstBaseCollider(collider); 114 | } 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstBaseCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c3f6cd117bfd01439d224443feba7a0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstBoxCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using Navigation.Scripts.Region; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | using UnityEngine.UIElements; 7 | 8 | namespace Vella.SimpleBurstCollision 9 | { 10 | public struct BurstBoxCollider : IBurstCollider 11 | { 12 | public float4x4 ToLocalMatrix; 13 | public float4x4 ToWorldMatrix; 14 | 15 | public Bounds Bounds; 16 | 17 | public Vector3 Right; 18 | public Vector3 Up; 19 | public Vector3 Forward; 20 | public Vector3 Center; 21 | public Vector3 Max; 22 | public Vector3 Min; 23 | 24 | public Vector3 V1; 25 | public Vector3 V2; 26 | public Vector3 V3; 27 | public Vector3 V4; 28 | public Vector3 V5; 29 | public Vector3 V6; 30 | public Vector3 V7; 31 | public Vector3 V8; 32 | 33 | public static readonly BurstBoxCollider Empty = new BurstBoxCollider(); 34 | } 35 | 36 | public static class BurstBoxColliderExtensions 37 | { 38 | public static void UpdateBounds(this BurstBoxCollider box) 39 | { 40 | box.Bounds = new Bounds(); 41 | box.Bounds.Encapsulate(box.V1); 42 | box.Bounds.Encapsulate(box.V2); 43 | box.Bounds.Encapsulate(box.V3); 44 | box.Bounds.Encapsulate(box.V4); 45 | box.Bounds.Encapsulate(box.V5); 46 | box.Bounds.Encapsulate(box.V6); 47 | box.Bounds.Encapsulate(box.V7); 48 | box.Bounds.Encapsulate(box.V8); 49 | } 50 | 51 | public static Vector3 ClosestPosition(this BurstBoxCollider box, Vector3 worldPosition) 52 | { 53 | return ClosestPosition(box, worldPosition, box.ToLocalMatrix, box.ToWorldMatrix); 54 | } 55 | 56 | public static Vector3 ClosestPosition(this BurstBoxCollider box, Vector3 worldPosition, float4x4 toLocal, float4x4 toWorld) 57 | { 58 | var localSphereCenter = math.transform(toLocal, worldPosition); 59 | var closest = box.ClosestLocalPosition(localSphereCenter); 60 | return math.transform(toWorld, closest); 61 | } 62 | 63 | public static Vector3 ClosestPosition(this BurstBoxCollider box, Vector3 worldPosition, float4x4 toLocal) 64 | { 65 | var localPosition = math.transform(toLocal, worldPosition); 66 | var closest = box.ClosestLocalPosition(localPosition); 67 | return math.transform(math.inverse(box.ToWorldMatrix), closest); 68 | } 69 | 70 | private static Vector3 ClosestLocalPosition(this BurstBoxCollider box, float3 localPosition) 71 | { 72 | var closestX = Mathf.Max(box.Min.x, Mathf.Min(localPosition.x, box.Max.x)); 73 | var closestY = Mathf.Max(box.Min.y, Mathf.Min(localPosition.y, box.Max.y)); 74 | var closestZ = Mathf.Max(box.Min.z, Mathf.Min(localPosition.z, box.Max.z)); 75 | var closest = new Vector3(closestX, closestY, closestZ); 76 | return closest; 77 | } 78 | 79 | public static bool Contains(this BurstBoxCollider box, Vector3 worldPosition) 80 | { 81 | var localPosition = box.GetLocalPosition(worldPosition); 82 | return localPosition.x > box.Min.x && localPosition.x < box.Max.x && 83 | localPosition.y > box.Min.y && localPosition.y < box.Max.y && 84 | localPosition.z > box.Min.z && localPosition.z < box.Max.z; 85 | } 86 | 87 | public static bool Contains(this BurstBoxCollider box, Vector3 worldPosition, float4x4 matrix) 88 | { 89 | var localPosition = math.transform(matrix, worldPosition); 90 | return localPosition.x > box.Min.x && localPosition.x < box.Max.x && 91 | localPosition.y > box.Min.y && localPosition.y < box.Max.y && 92 | localPosition.z > box.Min.z && localPosition.z < box.Max.z; 93 | } 94 | 95 | public static Vector3 GetWorldPosition(this BurstBoxCollider box, Vector3 localPosition) 96 | { 97 | return math.transform(box.ToWorldMatrix, localPosition); 98 | } 99 | 100 | public static Vector3 GetLocalPosition(this BurstBoxCollider box, Vector3 worldPosition) 101 | { 102 | return math.transform(box.ToLocalMatrix, worldPosition); 103 | } 104 | 105 | public static BurstBaseCollider ToBaseCollider(this BurstBoxCollider box) => new BurstBaseCollider 106 | { 107 | Type = BurstColliderType.Box, 108 | Box = box 109 | }; 110 | } 111 | } -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstBoxCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69897e60514a2f94e9540c1f8d1fcd00 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstColliderFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Navigation.Scripts.Region; 3 | using Unity.Mathematics; 4 | using UnityEngine; 5 | 6 | namespace Vella.SimpleBurstCollision 7 | { 8 | public static class BurstColliderFactory 9 | { 10 | public static BurstBaseCollider CreateFromCollider(Collider inputCollider) 11 | { 12 | var result = new BurstBaseCollider(); 13 | result.Id = inputCollider.gameObject.GetInstanceID(); 14 | switch (inputCollider) 15 | { 16 | case SphereCollider sphere: 17 | result.Type = BurstColliderType.Sphere; 18 | result.Sphere = CreateSphere(sphere); 19 | break; 20 | case BoxCollider box: 21 | result.Type = BurstColliderType.Box; 22 | result.Box = CreateBox(box); 23 | break; 24 | default: 25 | throw new InvalidOperationException(); 26 | } 27 | return result; 28 | } 29 | 30 | public static BurstSphereCollider CreateSphere(SphereCollider sphereCollider) => new BurstSphereCollider 31 | { 32 | Scale = GetLargestAxis(sphereCollider.transform.localScale), 33 | Center = sphereCollider.transform.position, 34 | Radius = sphereCollider.radius, 35 | Offset = sphereCollider.center, 36 | }; 37 | 38 | private static float GetLargestAxis(Vector3 v) 39 | { 40 | if (v.x > v.y && v.x > v.z) return v.x; 41 | if (v.y > v.x && v.y > v.z) return v.y; 42 | return v.z; 43 | } 44 | 45 | public static BurstSphereCollider CreateSphere(Vector3 center, float radius) => new BurstSphereCollider 46 | { 47 | Center = center, 48 | Radius = radius, 49 | Scale = 1, 50 | }; 51 | 52 | public static BurstSphereCollider CreateSphere(Vector3 center, Vector3 offset, float radius, float scale) => new BurstSphereCollider 53 | { 54 | Center = center, 55 | Offset = offset, 56 | Radius = radius, 57 | Scale = scale 58 | }; 59 | 60 | public static BurstBoxCollider CreateBox(BoxCollider c) 61 | { 62 | return CreateBox(c.transform); 63 | } 64 | 65 | public static BurstBoxCollider CreateBox(Transform t) 66 | { 67 | var matrix = new float4x4(t.rotation, t.position); 68 | return BurstBoxCollider(t.position, t.lossyScale, t.rotation, matrix); 69 | } 70 | 71 | public static BurstBoxCollider CreateBox(Vector3 center, Vector3 size, Quaternion rotation) 72 | { 73 | var matrix = math.mul(new float4x4(rotation, center), float4x4.Scale(size)); 74 | return BurstBoxCollider(center, size, rotation, matrix); 75 | } 76 | 77 | private static BurstBoxCollider BurstBoxCollider(Vector3 center, Vector3 size, Quaternion rotation, float4x4 matrix) 78 | { 79 | var max = size * 0.5f; 80 | var min = -max; 81 | 82 | var box = new BurstBoxCollider 83 | { 84 | Bounds = new Bounds(center, size), 85 | Center = center, 86 | Right = rotation * Vector3.right, 87 | Up = rotation * Vector3.up, 88 | Forward = rotation * Vector3.forward, 89 | Max = max, 90 | Min = min, 91 | ToWorldMatrix = matrix, 92 | ToLocalMatrix = math.inverse(matrix), 93 | 94 | V1 = center + rotation * min, 95 | V2 = center + rotation * new Vector3(max.x, min.y, min.z), 96 | V3 = center + rotation * new Vector3(min.x, max.y, min.z), 97 | V4 = center + rotation * new Vector3(max.x, max.y, min.z), 98 | V5 = center + rotation * new Vector3(min.x, min.y, max.z), 99 | V6 = center + rotation * new Vector3(max.x, min.y, max.z), 100 | V7 = center + rotation * new Vector3(min.x, max.y, max.z), 101 | V8 = center + rotation * max, 102 | }; 103 | 104 | box.UpdateBounds(); 105 | return box; 106 | } 107 | } 108 | 109 | } 110 | 111 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstColliderFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d44dc47d5f64b4344ad719ee671afbd9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstSphereCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using JetBrains.Annotations; 5 | using Unity.Burst; 6 | using Unity.Collections; 7 | using Unity.Mathematics; 8 | using UnityEngine; 9 | 10 | 11 | namespace Vella.SimpleBurstCollision 12 | { 13 | [DebuggerDisplay("Center = {Center}, Radius={Radius}")] 14 | public struct BurstSphereCollider : IBurstCollider 15 | { 16 | public Vector3 Center; 17 | public Vector3 Offset; 18 | public float Radius; 19 | public float Scale; 20 | 21 | public static readonly BurstSphereCollider Empty = new BurstSphereCollider(); 22 | 23 | public Bounds Bounds; 24 | } 25 | 26 | public static class BurstSphereColliderExtensions 27 | { 28 | public static List Intersects(this BurstSphereCollider testCollider, NativeArray colliders) 29 | { 30 | return IntersectionJobs.SphereSphereIntersectionJob.Execute(testCollider, colliders); 31 | } 32 | 33 | public static bool Contains(this BurstSphereCollider sphere, Vector3 worldPosition) 34 | { 35 | return math.distance(worldPosition, sphere.Center + sphere.Offset) <= sphere.Radius * sphere.Scale; 36 | } 37 | 38 | public static Vector3 ClosestPosition(this BurstSphereCollider sphere, Vector3 worldPosition) 39 | { 40 | return (worldPosition - sphere.Center + sphere.Offset) * sphere.Radius * sphere.Scale; 41 | } 42 | 43 | public static BurstBaseCollider ToBaseCollider(this BurstSphereCollider sphere) => new BurstBaseCollider 44 | { 45 | Type = BurstColliderType.Sphere, 46 | Sphere = sphere 47 | }; 48 | 49 | public static BurstBaseCollider ToBaseCollider(this BurstSphereCollider sphere, int id) => new BurstBaseCollider 50 | { 51 | Type = BurstColliderType.Sphere, 52 | Sphere = sphere, 53 | Id = id, 54 | }; 55 | } 56 | 57 | 58 | 59 | } 60 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/BurstSphereCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e44d2675bfaa3d419a246339e198d1e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/IBurstCollider.cs: -------------------------------------------------------------------------------- 1 |  2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace Vella.SimpleBurstCollision 7 | { 8 | public interface IBurstCollider 9 | { 10 | 11 | } 12 | 13 | public static class IBurstColliderExtensions 14 | { 15 | public static IEnumerable OfType(this IEnumerable collection) where T : IBurstCollider 16 | { 17 | foreach (var item in collection) 18 | { 19 | switch (item.Type) 20 | { 21 | case BurstColliderType.Box: 22 | if (typeof(T) == typeof(BurstBoxCollider)) 23 | { 24 | yield return (T)Convert.ChangeType(item.Box, typeof(T)); 25 | } 26 | break; 27 | case BurstColliderType.Sphere: 28 | if (typeof(T) == typeof(SphereCollider)) 29 | { 30 | yield return (T)Convert.ChangeType(item.Box, typeof(T)); 31 | } 32 | break; 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/IBurstCollider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 258d3c86ec71dd043ae188e0981c1fd6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/IntersectionJobs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using SimpleBurstCollision; 5 | using Unity.Burst; 6 | using Unity.Collections; 7 | using Unity.Collections.LowLevel.Unsafe; 8 | using Unity.Jobs; 9 | using Unity.Mathematics; 10 | using UnityEngine; 11 | 12 | namespace Vella.SimpleBurstCollision 13 | { 14 | public static class IntersectionJobs 15 | { 16 | [BurstCompile] 17 | public struct BaseIntersectionJob : IJob 18 | { 19 | public BurstBaseCollider TestCollider; 20 | public NativeArray OtherColliders; 21 | public NativeList ResultCollisions; 22 | 23 | public void Execute() 24 | { 25 | for (int i = 0; i < OtherColliders.Length; i++) 26 | { 27 | ref var other = ref OtherColliders.AsRef(i); 28 | if (TestCollider.Intersects(other)) 29 | { 30 | ResultCollisions.Add(other); 31 | } 32 | } 33 | } 34 | 35 | public static NativeList Execute(BurstBaseCollider testCollider, BurstBaseCollider[] otherColliders) 36 | { 37 | using (var nativeArray = new NativeArray(otherColliders, Allocator.TempJob)) 38 | { 39 | return Execute(testCollider, nativeArray); 40 | } 41 | } 42 | 43 | public static NativeList Execute(BurstBaseCollider testCollider, NativeArray otherColliders) 44 | { 45 | var resultStartingSize = (int)Math.Abs(Math.Floor(otherColliders.Length * 0.1f)); 46 | var result = new NativeList(resultStartingSize, Allocator.TempJob); 47 | new BaseIntersectionJob 48 | { 49 | TestCollider = testCollider, 50 | OtherColliders = otherColliders, 51 | ResultCollisions = result, 52 | 53 | }.Schedule().Complete(); 54 | return result; 55 | } 56 | } 57 | 58 | [BurstCompile] 59 | public struct SphereSphereIntersectionJob : IJob 60 | { 61 | [ReadOnly] 62 | public BurstSphereCollider TestCollider; 63 | 64 | public NativeArray OtherColliders; 65 | 66 | public NativeList NativeResultCollisions; 67 | 68 | public void Execute() 69 | { 70 | for (int i = 0; i < OtherColliders.Length; i++) 71 | { 72 | ref var other = ref OtherColliders.AsRef(i); 73 | if (DistanceSqr(ref TestCollider, other)) 74 | { 75 | NativeResultCollisions.Add(other); 76 | } 77 | } 78 | } 79 | 80 | public static bool DistanceSqr(ref BurstSphereCollider a, BurstSphereCollider b) 81 | { 82 | var combinedRadius = a.Radius + b.Radius; 83 | var offset = a.Center - b.Center; 84 | var sqrLen = offset.x * offset.x + offset.y * offset.y + offset.z * offset.z; 85 | return sqrLen <= combinedRadius * combinedRadius; 86 | } 87 | 88 | public static List Execute(BurstSphereCollider testCollider, NativeArray otherColliders) 89 | { 90 | using (var result = new NativeList(otherColliders.Length, Allocator.TempJob)) 91 | { 92 | new SphereSphereIntersectionJob 93 | { 94 | TestCollider = testCollider, 95 | OtherColliders = otherColliders, 96 | NativeResultCollisions = result, 97 | 98 | }.Schedule().Complete(); 99 | return result.ToArray().ToList(); 100 | } 101 | } 102 | } 103 | 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/IntersectionJobs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 460bbda810f8bbb408cb304a2cc28783 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Collisions/SimpleBurstCollision/IntersectionUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17829bcf42b50754787ea2f2160d9254 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/DebugDrawingExtension.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c541d45d6c9086d4daffcda6453ea58a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/DebugDrawingExtension/DebugExtension.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8c31fad9c50e0b48935ec9f0234354b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/DebugDrawingExtension/readme.txt: -------------------------------------------------------------------------------- 1 | Product : Debug Drawing Extension Package 2 | Studio : Arkham Interactive 3 | Date : September 17th, 2013 4 | Version : 1.1 5 | Email : support@arkhaminteractive.com 6 | 7 | - To use, simply add DebugExtension.cs to your Unity project 8 | - Call any of the static functions/overloads in DebugExtension from code to express debug information 9 | - Use 'Draw' functions anywhere you would use the 'UnityEngine.Gizmo' class (OnDrawGizmos() and OnDrawGizmosSelected()) 10 | - Use 'Debug' functions anywhere you would use the 'UnityEngine.Debug' class (Anywhere else) -------------------------------------------------------------------------------- /Assets/Plugins/DebugDrawingExtension/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a643d305f49ba4468b1635abde07d0a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/Math3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb50121997df6ad4e87e9f9d390acea0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aa1b6020a81d98d4ea657150c7b6b198 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 63b588f3892bb4b5eb73ad3d2791e05c 3 | folderAsset: yes 4 | timeCreated: 1477656493 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshAssetManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178d8366aa1616849b91b66285c51454 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshComponentsEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NavMeshComponentsEditor", 3 | "references": [ 4 | "NavMeshComponents" 5 | ], 6 | "optionalUnityReferences": [], 7 | "includePlatforms": [ 8 | "Editor" 9 | ], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": false, 13 | "precompiledReferences": [], 14 | "autoReferenced": true, 15 | "defineConstraints": [] 16 | } -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshComponentsEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86c9d8e67265f41469be06142c397d17 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshComponentsGUIUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77fba670b979046f18d52d751e0d4659 3 | timeCreated: 1480524815 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshLinkEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ece1e865d1ad84587872fe8580ab5a20 3 | timeCreated: 1477036743 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshModifierEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.AI; 2 | 3 | namespace UnityEditor.AI 4 | { 5 | [CanEditMultipleObjects] 6 | [CustomEditor(typeof(NavMeshModifier))] 7 | class NavMeshModifierEditor : Editor 8 | { 9 | SerializedProperty m_AffectedAgents; 10 | SerializedProperty m_Area; 11 | SerializedProperty m_IgnoreFromBuild; 12 | SerializedProperty m_OverrideArea; 13 | 14 | void OnEnable() 15 | { 16 | m_AffectedAgents = serializedObject.FindProperty("m_AffectedAgents"); 17 | m_Area = serializedObject.FindProperty("m_Area"); 18 | m_IgnoreFromBuild = serializedObject.FindProperty("m_IgnoreFromBuild"); 19 | m_OverrideArea = serializedObject.FindProperty("m_OverrideArea"); 20 | 21 | NavMeshVisualizationSettings.showNavigation++; 22 | } 23 | 24 | void OnDisable() 25 | { 26 | NavMeshVisualizationSettings.showNavigation--; 27 | } 28 | 29 | public override void OnInspectorGUI() 30 | { 31 | serializedObject.Update(); 32 | 33 | EditorGUILayout.PropertyField(m_IgnoreFromBuild); 34 | 35 | EditorGUILayout.PropertyField(m_OverrideArea); 36 | if (m_OverrideArea.boolValue) 37 | { 38 | EditorGUI.indentLevel++; 39 | NavMeshComponentsGUIUtility.AreaPopup("Area Type", m_Area); 40 | EditorGUI.indentLevel--; 41 | } 42 | 43 | NavMeshComponentsGUIUtility.AgentMaskPopup("Affected Agents", m_AffectedAgents); 44 | EditorGUILayout.Space(); 45 | 46 | serializedObject.ApplyModifiedProperties(); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshModifierEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fa04b4743e3947eba4d7b9e5832ea69 3 | timeCreated: 1477036742 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshModifierVolumeEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor.IMGUI.Controls; 2 | using UnityEditorInternal; 3 | using UnityEngine.AI; 4 | using UnityEngine; 5 | 6 | namespace UnityEditor.AI 7 | { 8 | [CanEditMultipleObjects] 9 | [CustomEditor(typeof(NavMeshModifierVolume))] 10 | class NavMeshModifierVolumeEditor : Editor 11 | { 12 | SerializedProperty m_AffectedAgents; 13 | SerializedProperty m_Area; 14 | SerializedProperty m_Center; 15 | SerializedProperty m_Size; 16 | 17 | static Color s_HandleColor = new Color(187f, 138f, 240f, 210f) / 255; 18 | static Color s_HandleColorDisabled = new Color(187f * 0.75f, 138f * 0.75f, 240f * 0.75f, 100f) / 255; 19 | 20 | BoxBoundsHandle m_BoundsHandle = new BoxBoundsHandle(); 21 | 22 | bool editingCollider 23 | { 24 | get { return EditMode.editMode == EditMode.SceneViewEditMode.Collider && EditMode.IsOwner(this); } 25 | } 26 | 27 | void OnEnable() 28 | { 29 | m_AffectedAgents = serializedObject.FindProperty("m_AffectedAgents"); 30 | m_Area = serializedObject.FindProperty("m_Area"); 31 | m_Center = serializedObject.FindProperty("m_Center"); 32 | m_Size = serializedObject.FindProperty("m_Size"); 33 | 34 | NavMeshVisualizationSettings.showNavigation++; 35 | } 36 | 37 | void OnDisable() 38 | { 39 | NavMeshVisualizationSettings.showNavigation--; 40 | } 41 | 42 | Bounds GetBounds() 43 | { 44 | var navModifier = (NavMeshModifierVolume)target; 45 | return new Bounds(navModifier.transform.position, navModifier.size); 46 | } 47 | 48 | public override void OnInspectorGUI() 49 | { 50 | serializedObject.Update(); 51 | 52 | EditMode.DoEditModeInspectorModeButton(EditMode.SceneViewEditMode.Collider, "Edit Volume", 53 | EditorGUIUtility.IconContent("EditCollider"), GetBounds, this); 54 | 55 | EditorGUILayout.PropertyField(m_Size); 56 | EditorGUILayout.PropertyField(m_Center); 57 | 58 | NavMeshComponentsGUIUtility.AreaPopup("Area Type", m_Area); 59 | NavMeshComponentsGUIUtility.AgentMaskPopup("Affected Agents", m_AffectedAgents); 60 | EditorGUILayout.Space(); 61 | 62 | serializedObject.ApplyModifiedProperties(); 63 | } 64 | 65 | [DrawGizmo(GizmoType.Selected | GizmoType.Active)] 66 | static void RenderBoxGizmo(NavMeshModifierVolume navModifier, GizmoType gizmoType) 67 | { 68 | var color = navModifier.enabled ? s_HandleColor : s_HandleColorDisabled; 69 | var colorTrans = new Color(color.r * 0.75f, color.g * 0.75f, color.b * 0.75f, color.a * 0.15f); 70 | 71 | var oldColor = Gizmos.color; 72 | var oldMatrix = Gizmos.matrix; 73 | 74 | Gizmos.matrix = navModifier.transform.localToWorldMatrix; 75 | 76 | Gizmos.color = colorTrans; 77 | Gizmos.DrawCube(navModifier.center, navModifier.size); 78 | 79 | Gizmos.color = color; 80 | Gizmos.DrawWireCube(navModifier.center, navModifier.size); 81 | 82 | Gizmos.matrix = oldMatrix; 83 | Gizmos.color = oldColor; 84 | 85 | Gizmos.DrawIcon(navModifier.transform.position, "NavMeshModifierVolume Icon", true); 86 | } 87 | 88 | [DrawGizmo(GizmoType.NotInSelectionHierarchy | GizmoType.Pickable)] 89 | static void RenderBoxGizmoNotSelected(NavMeshModifierVolume navModifier, GizmoType gizmoType) 90 | { 91 | if (NavMeshVisualizationSettings.showNavigation > 0) 92 | { 93 | var color = navModifier.enabled ? s_HandleColor : s_HandleColorDisabled; 94 | var oldColor = Gizmos.color; 95 | var oldMatrix = Gizmos.matrix; 96 | 97 | Gizmos.matrix = navModifier.transform.localToWorldMatrix; 98 | 99 | Gizmos.color = color; 100 | Gizmos.DrawWireCube(navModifier.center, navModifier.size); 101 | 102 | Gizmos.matrix = oldMatrix; 103 | Gizmos.color = oldColor; 104 | } 105 | 106 | Gizmos.DrawIcon(navModifier.transform.position, "NavMeshModifierVolume Icon", true); 107 | } 108 | 109 | void OnSceneGUI() 110 | { 111 | if (!editingCollider) 112 | return; 113 | 114 | var vol = (NavMeshModifierVolume)target; 115 | var color = vol.enabled ? s_HandleColor : s_HandleColorDisabled; 116 | using (new Handles.DrawingScope(color, vol.transform.localToWorldMatrix)) 117 | { 118 | m_BoundsHandle.center = vol.center; 119 | m_BoundsHandle.size = vol.size; 120 | 121 | EditorGUI.BeginChangeCheck(); 122 | m_BoundsHandle.DrawHandle(); 123 | if (EditorGUI.EndChangeCheck()) 124 | { 125 | Undo.RecordObject(vol, "Modified NavMesh Modifier Volume"); 126 | Vector3 center = m_BoundsHandle.center; 127 | Vector3 size = m_BoundsHandle.size; 128 | vol.center = center; 129 | vol.size = size; 130 | EditorUtility.SetDirty(target); 131 | } 132 | } 133 | } 134 | 135 | [MenuItem("GameObject/AI/NavMesh Modifier Volume", false, 2001)] 136 | static public void CreateNavMeshModifierVolume(MenuCommand menuCommand) 137 | { 138 | var parent = menuCommand.context as GameObject; 139 | var go = NavMeshComponentsGUIUtility.CreateAndSelectGameObject("NavMesh Modifier Volume", parent); 140 | go.AddComponent(); 141 | var view = SceneView.lastActiveSceneView; 142 | if (view != null) 143 | view.MoveToView(go.transform); 144 | } 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshModifierVolumeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0f3bef2a67ae4e139538afec3e59b03 3 | timeCreated: 1477036743 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c32167dbf3314852b6006a288eb449b 3 | timeCreated: 1476968447 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce67aa87f613246dda63a54a59c6399e 3 | folderAsset: yes 4 | timeCreated: 1477656493 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshComponents.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NavMeshComponents", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [], 6 | "excludePlatforms": [], 7 | "allowUnsafeCode": false, 8 | "overrideReferences": false, 9 | "precompiledReferences": [], 10 | "autoReferenced": true, 11 | "defineConstraints": [] 12 | } -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshComponents.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c4dd21966739024fbd72155091d199e 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshLink.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace UnityEngine.AI 4 | { 5 | [ExecuteInEditMode] 6 | [DefaultExecutionOrder(-101)] 7 | [AddComponentMenu("Navigation/NavMeshLink", 33)] 8 | [HelpURL("https://github.com/Unity-Technologies/NavMeshComponents#documentation-draft")] 9 | public class NavMeshLink : MonoBehaviour 10 | { 11 | [SerializeField] 12 | int m_AgentTypeID; 13 | public int agentTypeID { get { return m_AgentTypeID; } set { m_AgentTypeID = value; UpdateLink(); } } 14 | 15 | [SerializeField] 16 | Vector3 m_StartPoint = new Vector3(0.0f, 0.0f, -2.5f); 17 | public Vector3 startPoint { get { return m_StartPoint; } set { m_StartPoint = value; UpdateLink(); } } 18 | 19 | [SerializeField] 20 | Vector3 m_EndPoint = new Vector3(0.0f, 0.0f, 2.5f); 21 | public Vector3 endPoint { get { return m_EndPoint; } set { m_EndPoint = value; UpdateLink(); } } 22 | 23 | [SerializeField] 24 | float m_Width; 25 | public float width { get { return m_Width; } set { m_Width = value; UpdateLink(); } } 26 | 27 | [SerializeField] 28 | int m_CostModifier = -1; 29 | public int costModifier { get { return m_CostModifier; } set { m_CostModifier = value; UpdateLink(); } } 30 | 31 | [SerializeField] 32 | bool m_Bidirectional = true; 33 | public bool bidirectional { get { return m_Bidirectional; } set { m_Bidirectional = value; UpdateLink(); } } 34 | 35 | [SerializeField] 36 | bool m_AutoUpdatePosition; 37 | public bool autoUpdate { get { return m_AutoUpdatePosition; } set { SetAutoUpdate(value); } } 38 | 39 | [SerializeField] 40 | int m_Area; 41 | public int area { get { return m_Area; } set { m_Area = value; UpdateLink(); } } 42 | 43 | NavMeshLinkInstance m_LinkInstance = new NavMeshLinkInstance(); 44 | 45 | Vector3 m_LastPosition = Vector3.zero; 46 | Quaternion m_LastRotation = Quaternion.identity; 47 | 48 | static readonly List s_Tracked = new List(); 49 | 50 | void OnEnable() 51 | { 52 | AddLink(); 53 | if (m_AutoUpdatePosition && m_LinkInstance.valid) 54 | AddTracking(this); 55 | } 56 | 57 | void OnDisable() 58 | { 59 | RemoveTracking(this); 60 | m_LinkInstance.Remove(); 61 | } 62 | 63 | public void UpdateLink() 64 | { 65 | m_LinkInstance.Remove(); 66 | AddLink(); 67 | } 68 | 69 | static void AddTracking(NavMeshLink link) 70 | { 71 | #if UNITY_EDITOR 72 | if (s_Tracked.Contains(link)) 73 | { 74 | Debug.LogError("Link is already tracked: " + link); 75 | return; 76 | } 77 | #endif 78 | 79 | if (s_Tracked.Count == 0) 80 | NavMesh.onPreUpdate += UpdateTrackedInstances; 81 | 82 | s_Tracked.Add(link); 83 | } 84 | 85 | static void RemoveTracking(NavMeshLink link) 86 | { 87 | s_Tracked.Remove(link); 88 | 89 | if (s_Tracked.Count == 0) 90 | NavMesh.onPreUpdate -= UpdateTrackedInstances; 91 | } 92 | 93 | void SetAutoUpdate(bool value) 94 | { 95 | if (m_AutoUpdatePosition == value) 96 | return; 97 | m_AutoUpdatePosition = value; 98 | if (value) 99 | AddTracking(this); 100 | else 101 | RemoveTracking(this); 102 | } 103 | 104 | void AddLink() 105 | { 106 | #if UNITY_EDITOR 107 | if (m_LinkInstance.valid) 108 | { 109 | Debug.LogError("Link is already added: " + this); 110 | return; 111 | } 112 | #endif 113 | 114 | var link = new NavMeshLinkData(); 115 | link.startPosition = m_StartPoint; 116 | link.endPosition = m_EndPoint; 117 | link.width = m_Width; 118 | link.costModifier = m_CostModifier; 119 | link.bidirectional = m_Bidirectional; 120 | link.area = m_Area; 121 | link.agentTypeID = m_AgentTypeID; 122 | m_LinkInstance = NavMesh.AddLink(link, transform.position, transform.rotation); 123 | if (m_LinkInstance.valid) 124 | m_LinkInstance.owner = this; 125 | 126 | m_LastPosition = transform.position; 127 | m_LastRotation = transform.rotation; 128 | } 129 | 130 | bool HasTransformChanged() 131 | { 132 | if (m_LastPosition != transform.position) return true; 133 | if (m_LastRotation != transform.rotation) return true; 134 | return false; 135 | } 136 | 137 | void OnDidApplyAnimationProperties() 138 | { 139 | UpdateLink(); 140 | } 141 | 142 | static void UpdateTrackedInstances() 143 | { 144 | foreach (var instance in s_Tracked) 145 | { 146 | if (instance.HasTransformChanged()) 147 | instance.UpdateLink(); 148 | } 149 | } 150 | 151 | #if UNITY_EDITOR 152 | void OnValidate() 153 | { 154 | m_Width = Mathf.Max(0.0f, m_Width); 155 | 156 | if (!m_LinkInstance.valid) 157 | return; 158 | 159 | UpdateLink(); 160 | 161 | if (!m_AutoUpdatePosition) 162 | { 163 | RemoveTracking(this); 164 | } 165 | else if (!s_Tracked.Contains(this)) 166 | { 167 | AddTracking(this); 168 | } 169 | } 170 | #endif 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshLink.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6eeb5dc026fdf4b488bc7ae0138ab719 3 | timeCreated: 1477924439 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: 92f4afa3e25264f5b964937ccea49ff2, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshModifier.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace UnityEngine.AI 4 | { 5 | [ExecuteInEditMode] 6 | [AddComponentMenu("Navigation/NavMeshModifier", 32)] 7 | [HelpURL("https://github.com/Unity-Technologies/NavMeshComponents#documentation-draft")] 8 | public class NavMeshModifier : MonoBehaviour 9 | { 10 | [SerializeField] 11 | bool m_OverrideArea; 12 | public bool overrideArea { get { return m_OverrideArea; } set { m_OverrideArea = value; } } 13 | 14 | [SerializeField] 15 | int m_Area; 16 | public int area { get { return m_Area; } set { m_Area = value; } } 17 | 18 | [SerializeField] 19 | bool m_IgnoreFromBuild; 20 | public bool ignoreFromBuild { get { return m_IgnoreFromBuild; } set { m_IgnoreFromBuild = value; } } 21 | 22 | // List of agent types the modifier is applied for. 23 | // Special values: empty == None, m_AffectedAgents[0] =-1 == All. 24 | [SerializeField] 25 | List m_AffectedAgents = new List(new int[] { -1 }); // Default value is All 26 | 27 | static readonly List s_NavMeshModifiers = new List(); 28 | 29 | public static List activeModifiers 30 | { 31 | get { return s_NavMeshModifiers; } 32 | } 33 | 34 | void OnEnable() 35 | { 36 | if (!s_NavMeshModifiers.Contains(this)) 37 | s_NavMeshModifiers.Add(this); 38 | } 39 | 40 | void OnDisable() 41 | { 42 | s_NavMeshModifiers.Remove(this); 43 | } 44 | 45 | public bool AffectsAgentType(int agentTypeID) 46 | { 47 | if (m_AffectedAgents.Count == 0) 48 | return false; 49 | if (m_AffectedAgents[0] == -1) 50 | return true; 51 | return m_AffectedAgents.IndexOf(agentTypeID) != -1; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e3fdca004f2d45fe8abbed571a8abd5 3 | timeCreated: 1477924411 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: cc7b9475dbddf4f9088d327d6e10ab77, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshModifierVolume.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace UnityEngine.AI 4 | { 5 | [ExecuteInEditMode] 6 | [AddComponentMenu("Navigation/NavMeshModifierVolume", 31)] 7 | [HelpURL("https://github.com/Unity-Technologies/NavMeshComponents#documentation-draft")] 8 | public class NavMeshModifierVolume : MonoBehaviour 9 | { 10 | [SerializeField] 11 | Vector3 m_Size = new Vector3(4.0f, 3.0f, 4.0f); 12 | public Vector3 size { get { return m_Size; } set { m_Size = value; } } 13 | 14 | [SerializeField] 15 | Vector3 m_Center = new Vector3(0, 1.0f, 0); 16 | public Vector3 center { get { return m_Center; } set { m_Center = value; } } 17 | 18 | [SerializeField] 19 | int m_Area; 20 | public int area { get { return m_Area; } set { m_Area = value; } } 21 | 22 | // List of agent types the modifier is applied for. 23 | // Special values: empty == None, m_AffectedAgents[0] =-1 == All. 24 | [SerializeField] 25 | List m_AffectedAgents = new List(new int[] { -1 }); // Default value is All 26 | 27 | static readonly List s_NavMeshModifiers = new List(); 28 | 29 | public static List activeModifiers 30 | { 31 | get { return s_NavMeshModifiers; } 32 | } 33 | 34 | void OnEnable() 35 | { 36 | if (!s_NavMeshModifiers.Contains(this)) 37 | s_NavMeshModifiers.Add(this); 38 | } 39 | 40 | void OnDisable() 41 | { 42 | s_NavMeshModifiers.Remove(this); 43 | } 44 | 45 | public bool AffectsAgentType(int agentTypeID) 46 | { 47 | if (m_AffectedAgents.Count == 0) 48 | return false; 49 | if (m_AffectedAgents[0] == -1) 50 | return true; 51 | return m_AffectedAgents.IndexOf(agentTypeID) != -1; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshModifierVolume.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35e95dc5ff2b64380880dd7ac5922847 3 | timeCreated: 1477924430 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: cc7b9475dbddf4f9088d327d6e10ab77, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/NavMeshComponents/Scripts/NavMeshSurface.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a5ac11cc976e418e8d13136b07e1f52 3 | timeCreated: 1477658803 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {fileID: 2800000, guid: e4f97225bcfb64760a1c81f460837f01, type: 3} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b78458e1ec82434ab4f1a426b502365 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/BurstAStarPathFinder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a85c4a5aabe4df540b3fe6912c696aa7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe62c674a147dc74496bd1559722240a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/GridBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 886e6403b6463c74eb56fa10c46f3ddc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/GridNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing; 3 | using Navigation.Scripts.Region; 4 | using Vella.Common.Collections; 5 | using Vella.Common.Navigation; 6 | using UnityEditor; 7 | using UnityEditor.Experimental.GraphView; 8 | using UnityEngine; 9 | using UnityEngine.Analytics; 10 | 11 | namespace Providers.Grid 12 | { 13 | public struct GridNode : IEquatable 14 | { 15 | public float X; 16 | public float Y; 17 | public float Z; 18 | public Vector3 Center; 19 | public Vector3 NavigableCenter; 20 | public Vector3 Normal; 21 | public GridPoint GridPoint; 22 | public SimpleBounds Bounds; 23 | public Vector3 Size; 24 | public ulong Flags; 25 | 26 | public float GScore; 27 | public float HScore; 28 | public float FScore; 29 | public GridPoint ParentPoint; 30 | public int OpenId; 31 | public int ClosedId; 32 | 33 | public static bool operator ==(GridNode first, GridNode second) 34 | { 35 | return first.Equals(second); 36 | } 37 | 38 | public static bool operator !=(GridNode first, GridNode second) 39 | { 40 | return !(first.Equals(second)); 41 | } 42 | 43 | public bool IsWalkable 44 | { 45 | get => ((NodeFlags)Flags & NodeFlags.AllowWalk) != 0; 46 | set => SetFlag(NodeFlags.AllowWalk, value); 47 | } 48 | 49 | public bool Equals(GridNode other) 50 | { 51 | return GridPoint == other.GridPoint; 52 | } 53 | 54 | public override int GetHashCode() 55 | { 56 | return (int)Center.x * 13 ^ (int)Center.y * 23; 57 | } 58 | 59 | private void SetFlag(NodeFlags flag, bool value) 60 | { 61 | if (value) 62 | { 63 | AddFlags(flag); 64 | } 65 | else 66 | { 67 | RemoveFlags(flag); 68 | } 69 | } 70 | 71 | public bool AddFlags(NodeFlags flags) 72 | { 73 | if (flags != NodeFlags.None) 74 | { 75 | Flags |= (ulong)flags; 76 | return true; 77 | } 78 | return false; 79 | } 80 | public bool HasFlag(NodeFlags flags) 81 | { 82 | return (Flags & (ulong)flags) != 0; 83 | } 84 | 85 | public bool RemoveFlags(NodeFlags flags) 86 | { 87 | if (flags != NodeFlags.None) 88 | { 89 | Flags &= ~(ulong)flags; 90 | return true; 91 | } 92 | return false; 93 | } 94 | 95 | public bool RemoveArea(NodeFlags flags) 96 | { 97 | if (flags != NodeFlags.None) 98 | { 99 | Flags &= ~(ulong)flags; 100 | return true; 101 | } 102 | return false; 103 | } 104 | 105 | public void ResetNodeFlags() 106 | { 107 | Flags = 0; 108 | } 109 | 110 | internal void Reset() 111 | { 112 | ResetNodeFlags(); 113 | } 114 | 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/GridNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 312c2f0dcdbecc848a0f26b37b243bf2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/GridPoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Security.Cryptography.X509Certificates; 4 | using Unity.Mathematics; 5 | using UnityEngine; 6 | 7 | namespace Providers.Grid 8 | { 9 | public struct GridPoint : IEquatable 10 | { 11 | public readonly int X; 12 | public readonly int Y; 13 | public readonly int Z; 14 | public int QueueIndex; 15 | public float Priority; 16 | 17 | public GridPoint(int x, int y, int z) 18 | { 19 | this.X = x; 20 | this.Y = y; 21 | this.Z = z; 22 | this.QueueIndex = -1; 23 | this.Priority = -1; 24 | } 25 | 26 | public bool Equals(GridPoint other) 27 | { 28 | return X == other.X && Y == other.Y && Z == other.Z; 29 | } 30 | 31 | public static bool operator ==(GridPoint first, GridPoint second) 32 | { 33 | return first.X == second.X && first.Y == second.Y && first.Z == second.Z; 34 | } 35 | 36 | public static bool operator !=(GridPoint first, GridPoint second) 37 | { 38 | return first.X != second.X || first.Y != second.Y || first.Z != second.Z; 39 | } 40 | 41 | public static Vector3 operator +(GridPoint a, GridPoint b) 42 | { 43 | return new Vector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z); 44 | } 45 | 46 | public static Vector3 operator -(GridPoint a, GridPoint b) 47 | { 48 | return new Vector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z); 49 | } 50 | 51 | public static GridPoint operator -(GridPoint a) 52 | { 53 | return new GridPoint(-a.X, -a.Y, -a.Z); 54 | } 55 | 56 | public static implicit operator int3(GridPoint a) 57 | { 58 | return new int3(a.X, a.Y, a.Z); 59 | } 60 | 61 | public static implicit operator GridPoint(int3 a) 62 | { 63 | return new GridPoint(a.x, a.y, a.z); 64 | } 65 | 66 | public override int GetHashCode() 67 | { 68 | unchecked 69 | { 70 | var hashCode = X; 71 | hashCode = (hashCode * 397) ^ Y; 72 | hashCode = (hashCode * 397) ^ Z; 73 | return hashCode; 74 | } 75 | } 76 | 77 | public override bool Equals(object obj) 78 | { 79 | if (ReferenceEquals(null, obj)) return false; 80 | return obj is GridPoint other && Equals(other); 81 | } 82 | 83 | public override string ToString() 84 | { 85 | return $"[{X},{Y},{Z}]"; 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/GridPoint.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9f3350763c226844892a0bb14c3cc33 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/NavigationGrid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee38c66b4285d194682e9c2537bd8182 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/NodeFlags.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | #if UNITY_EDITOR 4 | using UnityEditor; 5 | using UnityEngine; 6 | #endif 7 | 8 | namespace Providers.Grid 9 | { 10 | [Flags] 11 | public enum NodeFlags : int 12 | { 13 | None = 0x00000000, 14 | AllowWalk = 0x00000001, 15 | AllowFlier = 0x00000002, 16 | AllowProjectile = 0x00000004, 17 | RayCast = 0x00000008, 18 | Navigation = 0x00000010, 19 | Combat = 0x00000020, 20 | Avoidance = 0x00000040, 21 | Obstacle = 0x00000080, 22 | Ranged = 0x00000100, 23 | NearEdge = 0x00000200, 24 | Pierce = 0x00000400, 25 | Monster = 0x00000800, 26 | Health = 0x00001000, 27 | //NearEdge = 0x00002000, 28 | //ProjectileBlocking = 0x00004000, 29 | //CriticalAvoidance = 0x00008000, 30 | //Backtrack = 0x00010000, 31 | //NearEdge = 0x00020000, 32 | //Obstacle = 0x00040000, 33 | //Unused20 = 0x00080000, 34 | //Unused21 = 0x00100000, 35 | //Unused22 = 0x00200000, 36 | //Unused23 = 0x00400000, 37 | //Unused24 = 0x00800000, 38 | //Unused25 = 0x01000000, 39 | //Unused26 = 0x02000000, 40 | //Unused27 = 0x04000000, 41 | //Unused28 = 0x08000000, 42 | //Unused29 = 0x10000000, 43 | //Unused30 = 0x20000000, 44 | //Unused31 = 0x40000000, 45 | //Unused32 = 0x80000000, 46 | //Unused33 = 0x100000000, 47 | //Unused34 = 0x200000000, 48 | //Unused35 = 0x400000000, 49 | //Unused36 = 0x800000000, 50 | //Unused37 = 0x1000000000, 51 | //Unused38 = 0x2000000000, 52 | //Unused39 = 0x4000000000, 53 | //Unused40 = 0x8000000000, 54 | //Unused41 = 0x10000000000, 55 | //Unused42 = 0x20000000000, 56 | //Unused43 = 0x40000000000, 57 | //Unused44 = 0x80000000000, 58 | //Unused45 = 0x100000000000, 59 | //Unused46 = 0x200000000000, 60 | //Unused47 = 0x400000000000, 61 | //Unused48 = 0x800000000000, 62 | //Unused49 = 0x1000000000000, 63 | //Unused50 = 0x2000000000000, 64 | //Unused51 = 0x4000000000000, 65 | //Unused52 = 0x8000000000000, 66 | //Unused53 = 0x10000000000000, 67 | //Unused54 = 0x20000000000000, 68 | //Unused55 = 0x40000000000000, 69 | //Unused56 = 0x80000000000000, 70 | //Unused57 = 0x100000000000000, 71 | //Unused58 = 0x200000000000000, 72 | //Unused59 = 0x400000000000000, 73 | //Unused60 = 0x800000000000000, 74 | //Unused61 = 0x1000000000000000, 75 | //Unused62 = 0x2000000000000000, 76 | //Unused63 = 0x4000000000000000, 77 | //Unused64 = 0x8000000000000000, 78 | } 79 | 80 | #if UNITY_EDITOR 81 | /// 82 | /// Flags enum dropdown GUI for selecting properties in the inspector 83 | /// 84 | [CustomPropertyDrawer(typeof(NodeFlags))] 85 | public class NodeFlagsDrawer : PropertyDrawer 86 | { 87 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 88 | { 89 | label = EditorGUI.BeginProperty(position, label, property); 90 | var oldValue = (Enum)fieldInfo.GetValue(property.serializedObject.targetObject); 91 | var newValue = EditorGUI.EnumFlagsField(position, label, oldValue); 92 | if (!newValue.Equals(oldValue)) 93 | { 94 | property.intValue = (int)Convert.ChangeType(newValue, fieldInfo.FieldType); 95 | } 96 | EditorGUI.EndProperty(); 97 | } 98 | } 99 | #endif 100 | } 101 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Grid/NodeFlags.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a739b1518ab8eeb4a972fc56c4e8770f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ba23d5271b37e04c90fb03d46e9b98f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Algorithms.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eee36410cb5f6f14b99eaf3105d0a805 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Algorithms/Bresenham.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Providers.Grid; 3 | using UnityEngine; 4 | 5 | namespace Grid.Algorithms 6 | { 7 | public class Bresenham 8 | { 9 | public static IEnumerable GetPointsOnLine(Vector3 pStart, Vector3 pEnd, float pSteps = 1) 10 | { 11 | return GetPointsOnLine((int)pStart.x, (int)pStart.y, (int)pStart.z, (int)pEnd.x, (int)pEnd.y, (int)pEnd.z); 12 | } 13 | 14 | public static IEnumerable GetPointsOnLine(int aX, int aY, int aZ, int bX, int bY, int bZ, float pSteps = 1) 15 | { 16 | Vector3 result; 17 | 18 | int xd, yd, zd; 19 | int ax, ay, az; 20 | int sx, sy, sz; 21 | int dx, dy, dz; 22 | 23 | dx = bX - aX; 24 | dy = bY - aY; 25 | dz = bZ - aZ; 26 | 27 | ax = Mathf.Abs(dx) << 1; 28 | ay = Mathf.Abs(dy) << 1; 29 | az = Mathf.Abs(dz) << 1; 30 | 31 | sx = (int)Mathf.Sign(dx); 32 | sy = (int)Mathf.Sign(dy); 33 | sz = (int)Mathf.Sign(dz); 34 | 35 | 36 | if (ax >= Mathf.Max(ay, az)) // x dominant 37 | { 38 | yd = ay - (ax >> 1); 39 | zd = az - (ax >> 1); 40 | for (; ; ) 41 | { 42 | result.x = (int)(aX / pSteps); 43 | result.y = (int)(aY / pSteps); 44 | result.z = (int)(aZ / pSteps); 45 | yield return result; 46 | 47 | if (aX == bX) 48 | yield break; 49 | 50 | if (yd >= 0) 51 | { 52 | aY += sy; 53 | yd -= ax; 54 | } 55 | 56 | if (zd >= 0) 57 | { 58 | aZ += sz; 59 | zd -= ax; 60 | } 61 | 62 | aX += sx; 63 | yd += ay; 64 | zd += az; 65 | } 66 | } 67 | 68 | if (ay >= Mathf.Max(ax, az)) // y dominant 69 | { 70 | xd = ax - (ay >> 1); 71 | zd = az - (ay >> 1); 72 | for (; ; ) 73 | { 74 | result.x = (int)(aX / pSteps); 75 | result.y = (int)(aY / pSteps); 76 | result.z = (int)(aZ / pSteps); 77 | yield return result; 78 | 79 | if (aY == bY) 80 | yield break; 81 | 82 | if (xd >= 0) 83 | { 84 | aX += sx; 85 | xd -= ay; 86 | } 87 | 88 | if (zd >= 0) 89 | { 90 | aZ += sz; 91 | zd -= ay; 92 | } 93 | 94 | aY += sy; 95 | xd += ax; 96 | zd += az; 97 | } 98 | } 99 | 100 | if (az >= Mathf.Max(ax, ay)) // z dominant 101 | { 102 | xd = ax - (az >> 1); 103 | yd = ay - (az >> 1); 104 | for (; ; ) 105 | { 106 | result.x = (int)(aX / pSteps); 107 | result.y = (int)(aY / pSteps); 108 | result.z = (int)(aZ / pSteps); 109 | yield return result; 110 | 111 | if (aZ == bZ) 112 | yield break; 113 | 114 | if (xd >= 0) 115 | { 116 | aX += sx; 117 | xd -= az; 118 | } 119 | 120 | if (yd >= 0) 121 | { 122 | aY += sy; 123 | yd -= az; 124 | } 125 | 126 | aZ += sz; 127 | xd += ax; 128 | yd += ay; 129 | } 130 | } 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Algorithms/Bresenham.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6bf3807fac314a41940489be1747bc4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/AreaDefinitions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Linq; 6 | using Unity.Collections; 7 | 8 | namespace Providers.Grid 9 | { 10 | public interface INativeArrayProducer where T : struct 11 | { 12 | NativeArray ToNativeArray(Allocator allocator); 13 | } 14 | 15 | [Serializable] 16 | public class AreaDefinitions : INativeArrayProducer 17 | { 18 | public virtual IDictionary Items { get; } 19 | 20 | public NativeArray ToNativeArray(Allocator allocator) 21 | { 22 | var nativeItems = Items.Values.Select(v => new NativeAreaDefinition 23 | { 24 | Index = v.Index, 25 | Weight = v.Weight, 26 | FlagValue = v.FlagValue 27 | 28 | }).ToArray(); 29 | 30 | return new NativeArray(nativeItems, allocator); 31 | } 32 | } 33 | 34 | public class AreaDefinitions : AreaDefinitions, IEnumerable> where T : struct, Enum 35 | { 36 | public AreaDefinitions() 37 | { 38 | Items = ((T[])Enum.GetValues(typeof(T))) 39 | .ToDictionary(k => (Enum)k, v => (AreaDefinition)AreaDefinition.FromFlag(v, 0f)); 40 | } 41 | 42 | public AreaDefinition this[T flag] => Items[flag] as AreaDefinition; 43 | public AreaDefinition this[int i] => Items.ElementAtOrDefault(i).Value as AreaDefinition; 44 | 45 | public void Add(T flag, float value) // for collection initializer 46 | { 47 | Items[flag].Weight = value; 48 | } 49 | 50 | public void SetWeight(T flag, float value) 51 | { 52 | Items[flag].Weight = value; 53 | } 54 | 55 | public void SetWeight(IEnumerable> weights) 56 | { 57 | foreach (var pair in weights) 58 | { 59 | Items[pair.Key].Weight = pair.Value; 60 | } 61 | } 62 | 63 | public override IDictionary Items { get; } 64 | 65 | public IEnumerator> GetEnumerator() => Items.Values.OfType>().GetEnumerator(); 66 | 67 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 68 | } 69 | 70 | public class AreaDefinition : AreaDefinition where T : Enum 71 | { 72 | public T Flag { get; set; } 73 | } 74 | 75 | [Serializable] 76 | public class AreaDefinition 77 | { 78 | public static AreaDefinition FromFlag(T flag, float weight) where T : Enum 79 | { 80 | var value = Convert.ToUInt64(flag); 81 | return new AreaDefinition 82 | { 83 | Weight = weight, 84 | Name = flag.ToString(), 85 | Index = (int)Math.Log(value, 2), 86 | FlagValue = value, 87 | Flag = flag, 88 | }; 89 | } 90 | 91 | public ulong FlagValue; 92 | public string Name; 93 | public int Index; 94 | public float Weight; 95 | } 96 | 97 | [Serializable] 98 | public struct NativeAreaDefinition 99 | { 100 | public int Index; 101 | public float Weight; 102 | public ulong FlagValue; 103 | } 104 | } -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/AreaDefinitions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85375772e9ac2584e8b82eb4e296e443 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d53ccfab120d0148a5ac525f1f1a174 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/IndexedList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Vella.Common.Collections 4 | { 5 | public class IndexedList : List 6 | { 7 | private int _current; 8 | 9 | public bool IsCyclic { get; set; } 10 | 11 | public int Index 12 | { 13 | get 14 | { 15 | ValidateCurrent(); 16 | return _current; 17 | } 18 | set 19 | { 20 | _current = value; 21 | ValidateCurrent(); 22 | } 23 | } 24 | 25 | public T CurrentOrDefault => Count > 0 ? this[Index] : default(T); 26 | 27 | public T Current => this[Index]; 28 | 29 | public bool IsCurrentLast => Count > 0 && this[Index].Equals(this[Count - 1]); 30 | 31 | public IndexedList(bool isCyclic = false) 32 | { 33 | IsCyclic = isCyclic; 34 | } 35 | 36 | public IndexedList(int capacity, bool isCyclic = false) : base(capacity) 37 | { 38 | IsCyclic = isCyclic; 39 | } 40 | 41 | public IndexedList(IEnumerable collection, bool isCyclic = false) : base(collection) 42 | { 43 | IsCyclic = isCyclic; 44 | } 45 | 46 | public bool Next() 47 | { 48 | var index = Index; 49 | Index = Index + 1; 50 | if (!IsCyclic) 51 | return Index == index + 1; 52 | return true; 53 | } 54 | 55 | public bool Previous() 56 | { 57 | var index = Index; 58 | Index = Index - 1; 59 | if (!IsCyclic) 60 | return Index == index - 1; 61 | return true; 62 | } 63 | 64 | private void ValidateCurrent() 65 | { 66 | if (_current == 0 || _current >= 0 && _current < Count) 67 | return; 68 | if (Count == 0) 69 | _current = 0; 70 | else if (IsCyclic) 71 | { 72 | if (_current < 0) 73 | _current = Count - 1 - (-_current - 1) % Count; 74 | else 75 | _current = _current % Count; 76 | } 77 | else 78 | _current = Compare(0, Count - 1, _current); 79 | } 80 | 81 | private static int Compare(int param0, int param1, int param2) 82 | { 83 | if (param2 < param0) return param0; 84 | return param2 <= param1 ? param2 : param1; 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/IndexedList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37ba1dacaaa2ab642b66e11e23b032c0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeArray2D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using System.Collections; 5 | 6 | namespace Unity.Collections 7 | { 8 | public struct NativeArray2D : IDisposable, IEnumerable where T : unmanaged 9 | { 10 | public NativeArray Internal; 11 | private readonly int _yLength; 12 | private readonly int _xLength; 13 | 14 | public NativeArray2D(int x, int y, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory) 15 | { 16 | Internal = new NativeArray(x * y, allocator); 17 | _yLength = y; 18 | _xLength = x; 19 | } 20 | 21 | public T this[int i] => Internal[i]; 22 | 23 | public T this[int x, int y] 24 | { 25 | get => Internal[CalculateIndex(x, y)]; 26 | set => Internal[CalculateIndex(x, y)] = value; 27 | } 28 | 29 | public int CalculateIndex(int x, int y) 30 | { 31 | return (x * _yLength) + y; 32 | } 33 | 34 | public unsafe ref T ByRef(int x, int y) 35 | { 36 | var ptr = Internal.GetUnsafePtr(); 37 | var idx = CalculateIndex(x,y); 38 | return ref ((T*)ptr)[idx]; 39 | } 40 | 41 | public int GetLength(int index) 42 | { 43 | switch (index) 44 | { 45 | case 0: return _xLength; 46 | case 1: return _yLength; 47 | } 48 | throw new ArgumentOutOfRangeException($"The dimension with Length index '{index}' doesn't exist"); 49 | } 50 | 51 | public int Length => Internal.Length; 52 | public void Dispose() => Internal.Dispose(); 53 | public IEnumerator GetEnumerator() => Internal.GetEnumerator(); 54 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeArray2D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 337ed55bae0048b4e8f7bee148260800 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeArray3D.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Unity.Collections.LowLevel.Unsafe; 4 | using System.Collections; 5 | using System.Diagnostics; 6 | using System.Linq; 7 | using System.Numerics; 8 | using System.Reflection; 9 | using System.Runtime.CompilerServices; 10 | using System.Runtime.InteropServices; 11 | using Providers.Grid; 12 | using Unity.Collections; 13 | using Unity.Mathematics; 14 | using UnityEngine; 15 | using UnityEngine.Internal; 16 | using UnityEngine.UIElements; 17 | 18 | namespace Unity.Collections 19 | { 20 | public struct NativeArray3D : IDisposable, IEnumerable where T : unmanaged 21 | { 22 | public NativeArray Internal; 23 | internal readonly int _yLength; 24 | internal readonly int _xLength; 25 | internal readonly int _zLength; 26 | internal readonly int _yzLength; 27 | 28 | public NativeArray3D(int x, int y, int z, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory) 29 | { 30 | Internal = new NativeArray(x * y * z, allocator); 31 | IsDisposed = false; 32 | _xLength = x; 33 | _yLength = y; 34 | _zLength = z; 35 | _yzLength = y * z; 36 | } 37 | 38 | public T this[int i] => Internal[i]; 39 | 40 | public T this[int x, int y, int z] 41 | { 42 | get => Internal[GetIndex(x, y, z)]; 43 | set => Internal[GetIndex(x, y, z)] = value; 44 | } 45 | 46 | public int GetIndex(int x, int y, int z) 47 | { 48 | /* 49 | 50 | (2D) 4x2 Layout: 51 | 52 | y0 y1 53 | x0: #0 | #1 54 | x1: #2 | #3 55 | x2: #4 | #5 56 | x3: #6 | #7 57 | 58 | >> x * yLen + y 59 | 60 | [0,0] = 0 * 2 + 0 = 0 61 | [0,1] = 0 * 2 + 1 = 1 62 | [1,0] = 1 * 2 + 0 = 2 63 | [1,1] = 1 * 2 + 1 = 3 64 | [2,0] = 2 * 2 + 0 = 4 65 | [2,1] = 2 * 2 + 1 = 5 66 | [3,0] = 3 * 2 + 0 = 6 67 | [3,1] = 3 * 2 + 1 = 7 68 | 69 | (3D) 2x2x2 Layout: 70 | 71 | y1 y2 72 | z0 z1 z0 z1 73 | x0: #0 / #1 | #3 / #4 74 | x1: #5 / #6 | #7 / #8 75 | 76 | >> (x * yLen * zLen) + (y * zLen) + z 77 | 78 | [0,0,0] = (0 * 2 * 2) + (0 * 2) + 0 = 0 79 | [0,0,1] = (0 * 2 * 2) + (0 * 2) + 1 = 1 80 | 81 | [0,1,0] = (0 * 2 * 2) + (1 * 2) + 0 = 2 82 | [0,1,1] = (0 * 2 * 2) + (1 * 2) + 1 = 3 83 | 84 | [1,0,0] = (1 * 2 * 2) + (0 * 2) + 0 = 4 85 | [1,0,1] = (1 * 2 * 2) + (0 * 2) + 1 = 5 86 | 87 | [1,1,0] = (1 * 2 * 2) + (1 * 2) + 0 = 6 88 | [1,1,1] = (1 * 2 * 2) + (1 * 2) + 1 = 7 89 | 90 | (3D) 2x2x3 Layout: 91 | 92 | >> (x * yLen * zLen) + (y * zLen) + z 93 | 94 | y0 y1 95 | z0 z1 z2 z0 z1 z2 96 | x0: #0 / #1 / #2 | #3 / #4 / #5 97 | x1: #6 / #7 / #8 | #9 / #10 / #11 98 | 99 | [0,0,0] = (0 * 2 * 3) + (0 * 3) + 0 = 0 100 | [0,0,1] = (0 * 2 * 3) + (0 * 3) + 1 = 1 101 | [0,0,2] = (0 * 2 * 3) + (0 * 3) + 2 = 2 102 | 103 | [0,1,0] = (0 * 2 * 3) + (1 * 3) + 0 = 3 104 | [0,1,1] = (0 * 2 * 3) + (1 * 3) + 1 = 4 105 | [0,1,2] = (0 * 2 * 3) + (1 * 3) + 2 = 5 106 | 107 | [1,0,0] = (1 * 2 * 3) + (0 * 3) + 0 = 6 108 | [1,0,1] = (1 * 2 * 3) + (0 * 3) + 1 = 7 109 | [1,0,2] = (1 * 2 * 3) + (0 * 3) + 2 = 8 110 | 111 | [1,1,0] = (1 * 2 * 3) + (1 * 3) + 0 = 9 112 | [1,1,1] = (1 * 2 * 3) + (1 * 3) + 1 = 10 113 | [1,1,2] = (1 * 2 * 3) + (1 * 3) + 2 = 11 114 | 115 | (3D) 3x3x3 Layout: 116 | 117 | y0 y1 y2 118 | z0 z1 z2 z0 z1 z2 z0 z1 z2 119 | x0: #0 / #1 / #3 | #4 / #5 / #6 | #7 / #8 / #9 120 | x1: #10 / #11 / #12 | #13 / #14 / #15 | #16 / #17 / #18 121 | x2: #19 / #20 / #21 | #22 / #23 / #24 | #25 / #26 / #27 122 | 123 | */ 124 | 125 | return x * _yzLength + y * _zLength + z; 126 | 127 | } 128 | 129 | public int3 Get3DIndexes(int idx) 130 | { 131 | int x = idx / (_yzLength); 132 | idx -= (x * _yzLength); 133 | int y = idx / _zLength; 134 | int z = idx % _zLength; 135 | return new int3(x, y, z); 136 | } 137 | 138 | //public unsafe ref T ByRefUnsafe(void* ptr, int i) 139 | //{ 140 | // return ref ((T*)ptr)[i]; 141 | //} 142 | 143 | //public unsafe ref T ByRefUnsafe(void* ptr, int x, int y, int z) 144 | //{ 145 | // return ref ((T*)ptr)[x * _yzLength + y * _zLength + z]; 146 | //} 147 | 148 | public unsafe ref T AsRef(int x, int y, int z) 149 | { 150 | var ptr = Internal.GetUnsafePtr(); 151 | var idx = GetIndex(x, y, z); 152 | return ref ((T*)ptr)[idx]; 153 | } 154 | 155 | public int GetLength(int index) 156 | { 157 | switch (index) 158 | { 159 | case 0: return _xLength; 160 | case 1: return _yLength; 161 | case 2: return _zLength; 162 | } 163 | throw new ArgumentOutOfRangeException($"The dimension with Length index '{index}' doesn't exist"); 164 | } 165 | 166 | public int Length => Internal.Length; 167 | public bool IsCreated => Internal.IsCreated; 168 | 169 | 170 | public void Dispose() 171 | { 172 | IsDisposed = true; 173 | Internal.Dispose(); 174 | } 175 | 176 | public bool IsDisposed { get; private set; } 177 | 178 | public IEnumerator GetEnumerator() => Internal.GetEnumerator(); 179 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 180 | 181 | } 182 | 183 | } 184 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeArray3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8feb57a516aa144a9c35577618e9c28 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeIndexList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Unity.Collections; 7 | using Unity.Collections.LowLevel.Unsafe; 8 | 9 | namespace SimpleBurstCollision 10 | { 11 | /// 12 | /// Lightweight collection to store a list of indexes to a NativeArray within a job. 13 | /// Calling ToList() returns only the subset of values that were flagged with Add(int index) from the original NativeArray; 14 | /// Similar in practice to pre-allocating a NativeList with a length to avoid in-job allocations. 15 | /// 16 | public struct NativeIndexList : IDisposable where T : unmanaged 17 | { 18 | private NativeArray _indices; 19 | 20 | [NativeDisableContainerSafetyRestriction] 21 | private readonly NativeArray _referenceArray; 22 | 23 | public NativeIndexList(NativeArray source, Allocator allocator = Allocator.Persistent) 24 | { 25 | _referenceArray = source; 26 | 27 | // Allocate an extra int of capacity to store a length counter at the start of the array. 28 | _indices = new NativeArray(source.Length + 1, allocator); 29 | } 30 | 31 | public void AddIndex(int index) 32 | { 33 | _indices[++_indices[0]] = index; 34 | } 35 | 36 | public int[] IndicesToArray() 37 | { 38 | return _indices.ToArray(Length); 39 | } 40 | 41 | public List ToList() 42 | { 43 | var result = new List(); 44 | var maxIndex = _indices[0]; 45 | for (int i = 1; i < maxIndex; i++) 46 | { 47 | result.Add(_referenceArray[i]); 48 | } 49 | return result; 50 | } 51 | 52 | public int Length => _indices[0] + 1; 53 | 54 | public void Dispose() 55 | { 56 | _indices.Dispose(); 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativeIndexList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 220f9dd80bdd6234a9df2d84eecaf9b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/NativePriorityQueue.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 067d9920274f9c240a09c426d1c370f4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/SplitArray.cs: -------------------------------------------------------------------------------- 1 | namespace Vella.Common.Collections 2 | { 3 | /// 4 | /// Alternative to 2D array that splits the memory size into many 1D arrays. 5 | /// May avoid the large object heap and causing fragmentation / OutOfMemoryException. 6 | /// At the cost of additional overhead and processing. 7 | /// 8 | public class SplitArray 9 | { 10 | public SplitArray(int sizeX, int sizeY) 11 | { 12 | LengthX = sizeX; 13 | LengthY = sizeY; 14 | _nodes = new IndexedList(sizeX); 15 | 16 | for (int ix = 0; ix < sizeX; ++ix) 17 | { 18 | _nodes.Add(new T[sizeY]); 19 | } 20 | } 21 | 22 | public int LengthX; 23 | public int LengthY; 24 | 25 | private readonly IndexedList _nodes; 26 | 27 | public T this[int indexX, int indexY] 28 | { 29 | get { return Get(indexX, indexY); } 30 | set { Set(indexX, indexY, value); } 31 | } 32 | 33 | private void Set(int x, int y, T value) 34 | { 35 | _nodes[x][y] = value; 36 | } 37 | 38 | private T Get(int x, int y) 39 | { 40 | return _nodes[x][y]; 41 | } 42 | 43 | public int GetLength(int dimension) 44 | { 45 | return dimension > 1 ? 0 : dimension == 1 ? LengthY : LengthX; 46 | } 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Collections/SplitArray.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a4d42f69353d22449c6e41bd0c6981f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Extensions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa6ad9b2c4a08b147a77e61375889e86 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Extensions/NativeArrayExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Unity.Collections; 7 | using Unity.Collections.LowLevel.Unsafe; 8 | 9 | 10 | public static class NativeArrayExtensions 11 | { 12 | public static unsafe ref T AsRef(this NativeArray arr, int index) where T : unmanaged 13 | { 14 | var ptr = arr.GetUnsafePtr(); 15 | return ref ((T*)ptr)[index]; 16 | } 17 | 18 | public static T[] ToArray(this NativeArray arr, int length) where T : unmanaged 19 | { 20 | var dst = new T[length]; 21 | NativeArray.Copy(arr, dst, length); 22 | return dst; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/Extensions/NativeArrayExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 542c4d1203100ec4e8ac7937326bbe2f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/SimpleBounds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e5c0151a689304547868cad5956a7cf6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/SimpleTransform.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using UnityEngine; 4 | using Unity.Mathematics; 5 | 6 | namespace Providers.Grid 7 | { 8 | /// 9 | /// A basic version of 'Transform' component using Unity.Mathematics so that it can be executed outside of Unity's environment. 10 | /// Doesn't combined world position from a transform hierarchy. 11 | /// 12 | public class SimpleTransform 13 | { 14 | private RigidTransform _transform; 15 | private Vector3 _scale; 16 | private float4x4 _toWorldMatrix; 17 | private float4x4 _toLocalMatrix; 18 | 19 | public Vector3 LocalPosition => _transform.pos; 20 | public Quaternion LocalRotation => _transform.rot; 21 | public Vector3 LocalScale => _scale; 22 | 23 | public float4x4 ToWorldMatrix => _toWorldMatrix; 24 | public float4x4 ToLocalMatrix => _toLocalMatrix; 25 | 26 | public Vector3 GetWorldPosition(Vector3 localPosition) 27 | { 28 | return math.transform(_toWorldMatrix, localPosition); 29 | } 30 | 31 | public Vector3 GetLocalPosition(Vector3 worldPosition) 32 | { 33 | return math.transform(_toLocalMatrix, worldPosition); 34 | } 35 | 36 | public void Set(Transform transform) 37 | { 38 | _scale = transform.localScale; 39 | _transform.pos = transform.position; 40 | _transform.rot = transform.rotation; 41 | _toWorldMatrix = transform.localToWorldMatrix; 42 | _toLocalMatrix = transform.worldToLocalMatrix; 43 | } 44 | 45 | public void Set(Vector3 position, Quaternion rotation, Vector3 scale) 46 | { 47 | _scale = scale; 48 | _transform.pos = position; 49 | _transform.rot = rotation; 50 | _toWorldMatrix = math.mul(new float4x4(_transform), float4x4.Scale(scale)); 51 | _toLocalMatrix = math.inverse(_toWorldMatrix); 52 | } 53 | } 54 | 55 | 56 | ///// 57 | ///// A basic version of 'Transform' component using Unity.Mathematics so that it can be executed outside of Unity's environment. 58 | ///// 59 | //public class SimpleTransformNoScale 60 | //{ 61 | // private RigidTransform _transform; 62 | // private Vector3 _scale; 63 | 64 | // public Vector3 LocalPosition => _transform.pos; 65 | // public Quaternion LocalRotation => _transform.rot; 66 | // public Vector3 GetWorldPosition(Vector3 localPosition) 67 | // { 68 | // return math.transform(_transform, localPosition); 69 | // } 70 | 71 | // public Vector3 GetLocalPosition(Vector3 worldPosition) 72 | // { 73 | // return math.transform(math.inverse(_transform), worldPosition); 74 | // } 75 | 76 | // public void Set(Vector3 position, Quaternion rotation) 77 | // { 78 | // _transform.pos = position; 79 | // _transform.rot = rotation; 80 | // NotifyChanged(); 81 | // } 82 | 83 | // private void NotifyChanged() 84 | // { 85 | // LastChanged = DateTime.UtcNow; 86 | // } 87 | 88 | // public DateTime LastChanged { get; private set; } = DateTime.MinValue; 89 | 90 | // public Matrix4x4 Matrix => Matrix4x4.TRS(_transform.pos, _transform.rot, Vector3.one); 91 | 92 | //} 93 | 94 | } 95 | 96 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/SimpleTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c7bd87747c14a348911173126e82be8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins/Navigation/Helpers/UnityColors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d0d840b854267a4ba9dcd87eeeea120 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 710a350824651ad47875fb5732916b40 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/CSGLevel.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc5c904847054e54ab7c81ab639b7e4e 3 | ModelImporter: 4 | serializedVersion: 25 5 | internalIDToNameTable: [] 6 | externalObjects: {} 7 | materials: 8 | importMaterials: 1 9 | materialName: 1 10 | materialSearch: 2 11 | materialLocation: 1 12 | animations: 13 | legacyGenerateAnimations: 4 14 | bakeSimulation: 0 15 | resampleCurves: 1 16 | optimizeGameObjects: 0 17 | motionNodeName: 18 | rigImportErrors: 19 | rigImportWarnings: 20 | animationImportErrors: 21 | animationImportWarnings: 22 | animationRetargetingWarnings: 23 | animationDoRetargetingWarnings: 0 24 | importAnimatedCustomProperties: 0 25 | importConstraints: 0 26 | animationCompression: 1 27 | animationRotationError: 0.5 28 | animationPositionError: 0.5 29 | animationScaleError: 0.5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | extraUserProperties: [] 33 | clipAnimations: [] 34 | isReadable: 0 35 | meshes: 36 | lODScreenPercentages: [] 37 | globalScale: 1 38 | meshCompression: 0 39 | addColliders: 0 40 | useSRGBMaterialColor: 1 41 | importVisibility: 1 42 | importBlendShapes: 1 43 | importCameras: 1 44 | importLights: 1 45 | swapUVChannels: 0 46 | generateSecondaryUV: 1 47 | useFileUnits: 1 48 | keepQuads: 0 49 | weldVertices: 1 50 | preserveHierarchy: 0 51 | skinWeightsMode: 0 52 | maxBonesPerVertex: 4 53 | minBoneWeight: 0.001 54 | meshOptimizationFlags: -1 55 | indexFormat: 0 56 | secondaryUVAngleDistortion: 8 57 | secondaryUVAreaDistortion: 15.000001 58 | secondaryUVHardAngle: 88 59 | secondaryUVPackMargin: 4 60 | useFileScale: 1 61 | previousCalculatedGlobalScale: 1 62 | hasPreviousCalculatedGlobalScale: 0 63 | tangentSpace: 64 | normalSmoothAngle: 60 65 | normalImportMode: 0 66 | tangentImportMode: 0 67 | normalCalculationMode: 4 68 | legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 69 | blendShapeNormalImportMode: 1 70 | normalSmoothingSource: 0 71 | referencedClips: [] 72 | importAnimation: 1 73 | copyAvatar: 0 74 | humanDescription: 75 | serializedVersion: 2 76 | human: [] 77 | skeleton: [] 78 | armTwist: 0.5 79 | foreArmTwist: 0.5 80 | upperLegTwist: 0.5 81 | legTwist: 0.5 82 | armStretch: 0.05 83 | legStretch: 0.05 84 | feetSpacing: 0 85 | rootMotionBoneName: 86 | hasTranslationDoF: 0 87 | hasExtraRoot: 0 88 | skeletonHasParents: 1 89 | lastHumanDescriptionAvatarSource: {instanceID: 0} 90 | animationType: 0 91 | humanoidOversampling: 1 92 | additionalBone: 0 93 | userData: 94 | assetBundleName: 95 | assetBundleVariant: 96 | -------------------------------------------------------------------------------- /Assets/Prefabs/CSGLevel.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d50685777066a5448b9ce4765575592 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d6a37bbcc766f943bffc918258eb1a4 3 | folderAsset: yes 4 | timeCreated: 1449151966 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Floor.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Floor 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - : 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _BumpMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailAlbedoMap: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailMask: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _DetailNormalMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _EmissionMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MainTex: 46 | m_Texture: {fileID: 2800000, guid: 6bdca92006e3ac2418f48650a2e8fcea, type: 3} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _MetallicGlossMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _OcclusionMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _ParallaxMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - : 1 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DetailNormalMapScale: 1 66 | - _DstBlend: 0 67 | - _GlossMapScale: 1 68 | - _Glossiness: 0.5 69 | - _GlossyReflections: 1 70 | - _Metallic: 0 71 | - _Mode: 0 72 | - _OcclusionStrength: 1 73 | - _Parallax: 0.02 74 | - _SmoothnessTextureChannel: 0 75 | - _SpecularHighlights: 1 76 | - _SrcBlend: 1 77 | - _UVSec: 0 78 | - _ZWrite: 1 79 | m_Colors: 80 | - : {r: 1, g: 1, b: 1, a: 1} 81 | - _Color: {r: 1, g: 1, b: 1, a: 1} 82 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 83 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8e10aad982fd9d439566c147abd457c 3 | timeCreated: 1453295628 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Obstacle.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Obstacle 11 | m_Shader: {fileID: 210, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHAPREMULTIPLY_ON 13 | m_LightmapFlags: 0 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: 20 | - ALWAYS 21 | m_SavedProperties: 22 | serializedVersion: 3 23 | m_TexEnvs: 24 | - _BumpMap: 25 | m_Texture: {fileID: 0} 26 | m_Scale: {x: 1, y: 1} 27 | m_Offset: {x: 0, y: 0} 28 | - _DetailAlbedoMap: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | - _DetailMask: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - _DetailNormalMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _EmissionMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _MainTex: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _MetallicGlossMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _OcclusionMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _ParallaxMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | m_Floats: 61 | - _BlendOp: 0 62 | - _BumpScale: 1 63 | - _CameraFadingEnabled: 0 64 | - _CameraFarFadeDistance: 2 65 | - _CameraNearFadeDistance: 1 66 | - _Cull: 2 67 | - _Cutoff: 0.5 68 | - _DetailNormalMapScale: 1 69 | - _DistortionBlend: 0.5 70 | - _DistortionEnabled: 0 71 | - _DistortionStrength: 1 72 | - _DistortionStrengthScaled: 0 73 | - _DstBlend: 10 74 | - _EmissionEnabled: 0 75 | - _FlipbookMode: 0 76 | - _GlossMapScale: 1 77 | - _Glossiness: 0.5 78 | - _GlossyReflections: 1 79 | - _LightingEnabled: 1 80 | - _Metallic: 0 81 | - _Mode: 3 82 | - _OcclusionStrength: 1 83 | - _Parallax: 0.02 84 | - _SmoothnessTextureChannel: 0 85 | - _SoftParticlesEnabled: 0 86 | - _SoftParticlesFarFadeDistance: 1 87 | - _SoftParticlesNearFadeDistance: 0 88 | - _SpecularHighlights: 1 89 | - _SrcBlend: 1 90 | - _UVSec: 0 91 | - _ZWrite: 0 92 | m_Colors: 93 | - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} 94 | - _Color: {r: 0.5, g: 0, b: 0.025490196, a: 0.46666667} 95 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 96 | - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} 97 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Obstacle.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e16acbd11315b294c8a8f7a865510993 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathEndMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: PathEndMaterial 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BlendOp: 0 61 | - _BumpScale: 1 62 | - _CameraFadingEnabled: 0 63 | - _CameraFarFadeDistance: 2 64 | - _CameraNearFadeDistance: 1 65 | - _ColorMode: 0 66 | - _Cull: 2 67 | - _Cutoff: 0.5 68 | - _DetailNormalMapScale: 1 69 | - _DistortionBlend: 0.5 70 | - _DistortionEnabled: 0 71 | - _DistortionStrength: 1 72 | - _DistortionStrengthScaled: 0 73 | - _DstBlend: 10 74 | - _EmissionEnabled: 0 75 | - _FlipbookMode: 0 76 | - _GlossMapScale: 0 77 | - _Glossiness: 0.5 78 | - _GlossyReflections: 1 79 | - _LightingEnabled: 0 80 | - _Metallic: 0.211 81 | - _Mode: 3 82 | - _OcclusionStrength: 1 83 | - _Parallax: 0.02 84 | - _SmoothnessTextureChannel: 1 85 | - _SoftParticlesEnabled: 0 86 | - _SoftParticlesFarFadeDistance: 1 87 | - _SoftParticlesNearFadeDistance: 0 88 | - _SpecularHighlights: 1 89 | - _SrcBlend: 1 90 | - _UVSec: 0 91 | - _ZWrite: 0 92 | m_Colors: 93 | - _CameraFadeParams: {r: 0, g: 0, b: 0, a: 0} 94 | - _Color: {r: 0, g: 0, b: 0, a: 0.42745098} 95 | - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} 96 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 97 | - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} 98 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathEndMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af6fe5f13f4e67649b5352f0241d2914 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathLineA.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: PathLineA 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 13 | m_LightmapFlags: 0 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BlendOp: 0 60 | - _BumpScale: 1 61 | - _CameraFadingEnabled: 0 62 | - _CameraFarFadeDistance: 2 63 | - _CameraNearFadeDistance: 1 64 | - _Cull: 2 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DistortionBlend: 0.5 68 | - _DistortionEnabled: 0 69 | - _DistortionStrength: 1 70 | - _DistortionStrengthScaled: 0 71 | - _DstBlend: 0 72 | - _EmissionEnabled: 0 73 | - _FlipbookMode: 0 74 | - _GlossMapScale: 1 75 | - _Glossiness: 0.5 76 | - _GlossyReflections: 1 77 | - _LightingEnabled: 1 78 | - _Metallic: 0 79 | - _Mode: 0 80 | - _OcclusionStrength: 1 81 | - _Parallax: 0.02 82 | - _SmoothnessTextureChannel: 1 83 | - _SoftParticlesEnabled: 0 84 | - _SoftParticlesFarFadeDistance: 1 85 | - _SoftParticlesNearFadeDistance: 0 86 | - _SpecularHighlights: 1 87 | - _SrcBlend: 1 88 | - _UVSec: 0 89 | - _ZWrite: 1 90 | m_Colors: 91 | - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} 92 | - _Color: {r: 0, g: 0, b: 0, a: 1} 93 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 94 | - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} 95 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathLineA.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa438e2a14377c54f851fd92784a2331 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathStartMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: PathStartMaterial 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _EMISSION 13 | m_LightmapFlags: 0 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BlendOp: 0 60 | - _BumpScale: 1 61 | - _CameraFadingEnabled: 0 62 | - _CameraFarFadeDistance: 2 63 | - _CameraNearFadeDistance: 1 64 | - _Cull: 2 65 | - _Cutoff: 0.5 66 | - _DetailNormalMapScale: 1 67 | - _DistortionBlend: 0.5 68 | - _DistortionEnabled: 0 69 | - _DistortionStrength: 1 70 | - _DistortionStrengthScaled: 0 71 | - _DstBlend: 0 72 | - _EmissionEnabled: 0 73 | - _FlipbookMode: 0 74 | - _GlossMapScale: 1 75 | - _Glossiness: 0.5 76 | - _GlossyReflections: 1 77 | - _LightingEnabled: 1 78 | - _Metallic: 0 79 | - _Mode: 0 80 | - _OcclusionStrength: 1 81 | - _Parallax: 0.02 82 | - _SmoothnessTextureChannel: 0 83 | - _SoftParticlesEnabled: 0 84 | - _SoftParticlesFarFadeDistance: 1 85 | - _SoftParticlesNearFadeDistance: 0 86 | - _SpecularHighlights: 1 87 | - _SrcBlend: 1 88 | - _UVSec: 0 89 | - _ZWrite: 1 90 | m_Colors: 91 | - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} 92 | - _Color: {r: 1, g: 1, b: 1, a: 1} 93 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 94 | - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} 95 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/PathStartMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a48b128946f248c44a3fa389d2ab20c6 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18b094165b0e9624686a6ca1c91a6973 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Floor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffvella/UnityAStarNavigation/2efa2673d583572d25ddc83b9ae28a37ed308537/Assets/Prefabs/Materials/Textures/Floor.png -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Floor.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bdca92006e3ac2418f48650a2e8fcea 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 8 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 2 35 | aniso: 4 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 256 64 | resizeAlgorithm: 0 65 | textureFormat: 7 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 256 75 | resizeAlgorithm: 0 76 | textureFormat: 7 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: iPhone 85 | maxTextureSize: 256 86 | resizeAlgorithm: 0 87 | textureFormat: 7 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | spriteSheet: 95 | serializedVersion: 2 96 | sprites: [] 97 | outline: [] 98 | physicsShape: [] 99 | bones: [] 100 | spriteID: 101 | internalID: 0 102 | vertices: [] 103 | indices: 104 | edges: [] 105 | weights: [] 106 | secondaryTextures: [] 107 | spritePackingTag: 108 | pSDRemoveMatte: 0 109 | pSDShowRemoveMatteOption: 0 110 | userData: 111 | assetBundleName: 112 | assetBundleVariant: 113 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Wall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffvella/UnityAStarNavigation/2efa2673d583572d25ddc83b9ae28a37ed308537/Assets/Prefabs/Materials/Textures/Wall.png -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Wall.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbde78473e3c32c4a8444168e94b275f 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 8 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: -1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 2 35 | aniso: 16 36 | mipBias: -100 37 | wrapU: 0 38 | wrapV: 0 39 | wrapW: 0 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 50 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 512 64 | resizeAlgorithm: 0 65 | textureFormat: 7 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 512 75 | resizeAlgorithm: 0 76 | textureFormat: 7 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | - serializedVersion: 2 84 | buildTarget: iPhone 85 | maxTextureSize: 512 86 | resizeAlgorithm: 0 87 | textureFormat: 7 88 | textureCompression: 1 89 | compressionQuality: 50 90 | crunchedCompression: 0 91 | allowsAlphaSplitting: 0 92 | overridden: 0 93 | androidETC2FallbackOverride: 0 94 | spriteSheet: 95 | serializedVersion: 2 96 | sprites: [] 97 | outline: [] 98 | physicsShape: [] 99 | bones: [] 100 | spriteID: 101 | internalID: 0 102 | vertices: [] 103 | indices: 104 | edges: [] 105 | weights: [] 106 | secondaryTextures: [] 107 | spritePackingTag: 108 | pSDRemoveMatte: 0 109 | pSDShowRemoveMatteOption: 0 110 | userData: 111 | assetBundleName: 112 | assetBundleVariant: 113 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffvella/UnityAStarNavigation/2efa2673d583572d25ddc83b9ae28a37ed308537/Assets/Prefabs/Materials/Textures/Window.png -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/Window.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbec57328563bc34580a5fdffdfd19ac 3 | timeCreated: 1522076513 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 2 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: 0.5, y: 0.5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | spriteTessellationDetail: -1 49 | textureType: 5 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | serializedVersion: 2 53 | sprites: [] 54 | outline: [] 55 | spritePackingTag: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/roughess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffvella/UnityAStarNavigation/2efa2673d583572d25ddc83b9ae28a37ed308537/Assets/Prefabs/Materials/Textures/roughess.png -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Textures/roughess.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8631cf7d6ef122942ad3bc7c8b8a2257 3 | timeCreated: 1522076513 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 1 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -3 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 2 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: 0.5, y: 0.5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | spriteTessellationDetail: -1 49 | textureType: 5 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | serializedVersion: 2 53 | sprites: [] 54 | outline: [] 55 | spritePackingTag: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Wall.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Wall 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - : 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _BumpMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailAlbedoMap: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailMask: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _DetailNormalMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _EmissionMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MainTex: 46 | m_Texture: {fileID: 2800000, guid: bbde78473e3c32c4a8444168e94b275f, type: 3} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _MetallicGlossMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _OcclusionMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _ParallaxMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - : 1 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DetailNormalMapScale: 1 66 | - _DstBlend: 0 67 | - _GlossMapScale: 1 68 | - _Glossiness: 0.5 69 | - _GlossyReflections: 1 70 | - _Metallic: 0 71 | - _Mode: 0 72 | - _OcclusionStrength: 1 73 | - _Parallax: 0.02 74 | - _SmoothnessTextureChannel: 0 75 | - _SpecularHighlights: 1 76 | - _SrcBlend: 1 77 | - _UVSec: 0 78 | - _ZWrite: 1 79 | m_Colors: 80 | - : {r: 1, g: 1, b: 1, a: 1} 81 | - _Color: {r: 1, g: 1, b: 1, a: 1} 82 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 83 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Wall.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca37785d773692b47bd7339c9dd802ce 3 | timeCreated: 1452705603 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Window.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Window 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - : 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _BumpMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailAlbedoMap: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailMask: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _DetailNormalMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _EmissionMap: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MainTex: 46 | m_Texture: {fileID: 2800000, guid: cbec57328563bc34580a5fdffdfd19ac, type: 3} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _MetallicGlossMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _OcclusionMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _ParallaxMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - : 1 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DetailNormalMapScale: 1 66 | - _DstBlend: 0 67 | - _GlossMapScale: 1 68 | - _Glossiness: 0.5 69 | - _GlossyReflections: 1 70 | - _Metallic: 0 71 | - _Mode: 0 72 | - _OcclusionStrength: 1 73 | - _Parallax: 0.02 74 | - _SmoothnessTextureChannel: 0 75 | - _SpecularHighlights: 1 76 | - _SrcBlend: 1 77 | - _UVSec: 0 78 | - _ZWrite: 1 79 | m_Colors: 80 | - : {r: 1, g: 1, b: 1, a: 0.341} 81 | - _Color: {r: 1, g: 1, b: 1, a: 1} 82 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 83 | -------------------------------------------------------------------------------- /Assets/Prefabs/Materials/Window.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b97ec88e269e0554980e460da975d229 3 | timeCreated: 1452705603 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d340d89c909ebb4ea8710d9b5f5427b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/NavMeshLevel 1.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2f3bab51f0009340868bdabffe70ca3 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes/NavMeshLevel 1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83a8580b302abcf4896297c511b2c20d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes/NavMeshLevel 1/NavMesh-NavMesh.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeffvella/UnityAStarNavigation/2efa2673d583572d25ddc83b9ae28a37ed308537/Assets/Scenes/NavMeshLevel 1/NavMesh-NavMesh.asset -------------------------------------------------------------------------------- /Assets/Scenes/NavMeshLevel 1/NavMesh-NavMesh.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b185bd4d92b9a3d449c7562d01e29859 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 23800000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88ddb9c9eb4c5a7468e0534c4ca6ba18 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/GridManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Providers.Grid; 4 | using UnityEngine; 5 | using Debug = UnityEngine.Debug; 6 | 7 | #if UNITY_EDITOR 8 | using UnityEditor; 9 | #endif 10 | 11 | [ExecuteInEditMode] 12 | public class GridManager : MonoBehaviour 13 | { 14 | [Header("Grid Options")] 15 | public NodeFlags DefaultFlags = NodeFlags.AllowWalk; 16 | public float BoxSize = 2.5f; 17 | public Vector3 Size; 18 | 19 | public List Obstacles; 20 | 21 | [Header("NavMeshTracing Options")] 22 | public float RequiredProximity = 0.5f; 23 | public float EdgeWidth = 0.2f; 24 | 25 | public bool RequireVerticalAlign = true; 26 | public bool ShowGridBounds = true; 27 | public bool DrawGridPoints = true; 28 | 29 | public NavigationGrid Grid { get; set; } 30 | 31 | public bool IsValid => Grid != null && Grid.NodeCount > 0 && !Grid.InnerGrid.IsDisposed; 32 | 33 | private void Awake() 34 | { 35 | BuildGrid(); 36 | } 37 | 38 | public void BuildGrid() 39 | { 40 | Debug.Log("GridManager.BuildGrid"); 41 | 42 | if (BoxSize < 0.1f) 43 | BoxSize = 1; 44 | 45 | 46 | Grid?.Dispose(); 47 | Grid = NavigationGrid.Create((int) Size.x, (int) Size.y, (int) Size.z, transform.position, transform.rotation, transform.localScale, BoxSize); 48 | 49 | UpdateWalkableAreas(); 50 | } 51 | 52 | public Vector3 GetVertexWorldPosition(Vector3 vertex, Transform owner) 53 | { 54 | return owner.localToWorldMatrix.MultiplyPoint3x4(vertex); 55 | } 56 | 57 | public void UpdateWalkableAreas() 58 | { 59 | GridNodeJobs.AllNodes.TraceNavMesh.Execute(Grid, RequiredProximity, EdgeWidth, RequireVerticalAlign, NodeFlags.Navigation, NodeFlags.NearEdge, DefaultFlags); 60 | } 61 | 62 | private void Update() 63 | { 64 | if (Grid == null) 65 | { 66 | BuildGrid(); 67 | } 68 | 69 | if (DrawGridPoints) 70 | { 71 | foreach (var node in Grid.InnerGrid) 72 | { 73 | if (node.HasFlag(NodeFlags.Avoidance)) 74 | { 75 | DebugExtension.DebugWireSphere(Grid.ToWorldPosition(node.NavigableCenter), UnityColors.OrangeRed, 0.1f); 76 | 77 | } 78 | else if (node.HasFlag(NodeFlags.NearEdge)) 79 | { 80 | DebugExtension.DebugPoint(Grid.ToWorldPosition(node.NavigableCenter), UnityColors.Gray, 0.2f); 81 | } 82 | else if (node.HasFlag(NodeFlags.Navigation)) 83 | { 84 | DebugExtension.DebugPoint(Grid.ToWorldPosition(node.NavigableCenter), UnityColors.Blue, 0.2f); 85 | } 86 | } 87 | } 88 | } 89 | 90 | private void OnDrawGizmos() 91 | { 92 | if (Grid != null) 93 | { 94 | Gizmos.matrix = Grid.Transform.ToWorldMatrix; 95 | 96 | if (ShowGridBounds) 97 | { 98 | Gizmos.color = Color.black; 99 | Gizmos.DrawWireCube(Grid.LocalDataBounds.center* Grid.BoxSize + Grid.BoxOffset, Grid.LocalDataBounds.size* Grid.BoxSize); 100 | } 101 | } 102 | } 103 | 104 | void OnEnable() 105 | { 106 | #if UNITY_EDITOR 107 | EditorApplication.playModeStateChanged += EditorApplication_playModeStateChanged; 108 | #endif 109 | } 110 | 111 | #if UNITY_EDITOR 112 | private void EditorApplication_playModeStateChanged(PlayModeStateChange state) 113 | { 114 | switch (state) 115 | { 116 | case PlayModeStateChange.ExitingEditMode: 117 | case PlayModeStateChange.ExitingPlayMode: 118 | EnsureDestroyed(); 119 | break; 120 | } 121 | } 122 | #endif 123 | 124 | void OnDestroy() => EnsureDestroyed(); 125 | void OnDisable() 126 | { 127 | #if UNITY_EDITOR 128 | EditorApplication.playModeStateChanged -= EditorApplication_playModeStateChanged; 129 | #endif 130 | EnsureDestroyed(); 131 | } 132 | 133 | private void EnsureDestroyed() 134 | { 135 | Grid?.Dispose(); 136 | NavMeshExtensions.Dispose(); 137 | } 138 | 139 | } 140 | 141 | #if UNITY_EDITOR 142 | 143 | [CustomEditor(typeof(GridManager))] 144 | [CanEditMultipleObjects] 145 | public class GridManager_Editor : Editor 146 | { 147 | public override void OnInspectorGUI() 148 | { 149 | DrawDefaultInspector(); 150 | 151 | foreach (var targ in targets.Cast()) 152 | { 153 | var grid = targ.Grid; 154 | 155 | if (GUILayout.Button("Generate Grid") || grid == null) 156 | { 157 | targ.BuildGrid(); 158 | } 159 | 160 | if (GUILayout.Button("Update Edges") || grid == null) 161 | { 162 | NavMeshExtensions.CalculateEdges(UnityEngine.AI.NavMesh.CalculateTriangulation()); 163 | SceneView.RepaintAll(); 164 | } 165 | 166 | if (grid != null) 167 | { 168 | GUILayout.Label($"Nodes: {grid.InnerGrid.Length}"); 169 | GUILayout.Label($"InnerArraySize: {grid.InnerGrid.Length}"); 170 | } 171 | } 172 | } 173 | } 174 | 175 | #endif -------------------------------------------------------------------------------- /Assets/Scripts/GridManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba066f52640b8ff43956457f633922fd 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/GridNodeJobs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580eb7613f5760949bc2b82192172230 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/GridVolumeModifier.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Diagnostics; 3 | using System.Linq; 4 | using Providers.Grid; 5 | using UnityEngine; 6 | using Vella.SimpleBurstCollision; 7 | using Vector3 = UnityEngine.Vector3; 8 | 9 | [ExecuteInEditMode] 10 | public class GridVolumeModifier : MonoBehaviour 11 | { 12 | //public NodeFlagSettingGroup NodeFlagsSettings; 13 | //public bool ShowNodeFlags; 14 | 15 | [Header("Setup")] 16 | public GridManager GridManager; 17 | public Collider Collider; 18 | public NodeFlags AddFlags; 19 | public NodeFlags RemoveFlags; 20 | public NodeFlags Restriction; 21 | 22 | [Header("Debug Options")] 23 | public bool ShowPointsOnCollider; 24 | public bool ShowScannedNodes; 25 | public bool ShowClosestNode; 26 | public bool LogPerformance; 27 | 28 | public bool ExecuteInEditMode; 29 | 30 | private BurstBoxCollider Box; 31 | 32 | void Start() 33 | { 34 | if (Collider == null) 35 | { 36 | Collider = GetComponent(); 37 | } 38 | } 39 | 40 | private GridNode _closestNodeToCenter; 41 | private List _touchedNodes = new List(); 42 | private readonly List _colliderPoints = new List(); 43 | private List _nodesInRange = new List(); 44 | private Stopwatch _stopwatch = new Stopwatch(); 45 | private int[] _trackedIndices; 46 | 47 | void Update() 48 | { 49 | if (!ExecuteInEditMode && !Application.isPlaying) 50 | return; 51 | 52 | if (GridManager == null || !GridManager.IsValid) 53 | return; 54 | 55 | if (!isActiveAndEnabled || !transform.hasChanged) 56 | return; 57 | 58 | Box = BurstColliderFactory.CreateBox(transform); 59 | 60 | if (LogPerformance) 61 | { 62 | _stopwatch.Restart(); 63 | } 64 | 65 | var box = BurstColliderFactory.CreateBox(Collider as BoxCollider); 66 | 67 | _closestNodeToCenter = GridManager.Grid.FindClosestNode(Box.Center); 68 | 69 | _nodesInRange.Clear(); 70 | _touchedNodes.Clear(); 71 | 72 | if (GridManager.Grid.CollidesWithNode(Collider, _closestNodeToCenter, out float gapDistance, out Vector3 pointOnCollider)) 73 | { 74 | //var scanDistance = 1 + (int) Math.Round((Collider.bounds.size.x / 2f) - gapDistance, MidpointRounding.AwayFromZero); 75 | 76 | //var boxWorldMin = Box.Center - Box.Min; 77 | //var boxWorldMax = Box.Center - Box.Max; 78 | 79 | //var a = math.transform(Box.ToWorldMatrix, Box.Min); 80 | //var b = math.transform(Box.ToWorldMatrix, Box.Max); 81 | 82 | //DebugExtension.DebugWireSphere(a, Color.yellow, 0.1f); 83 | //DebugExtension.DebugWireSphere(b, Color.yellow, 0.1f); 84 | 85 | //var minNode = GridManager.Grid.FindClosestNode(Box.Bounds.min); 86 | //var maxNode = GridManager.Grid.FindClosestNode(Box.Bounds.max); 87 | 88 | //var debug1 = GridManager.Grid.ToWorldPosition(minNode.Center); 89 | //var debug2 = GridManager.Grid.ToWorldPosition(maxNode.Center); 90 | 91 | //DebugExtension.DebugWireSphere(debug1, Color.red, 0.1f); 92 | //DebugExtension.DebugWireSphere(debug2, Color.red, 0.1f); 93 | 94 | //var sw = Stopwatch.StartNew(); 95 | 96 | _trackedIndices = GridNodeJobs.AllNodes.IntersectionDiff.SetFlagsInBoxDiff.Run(GridManager.Grid, (ulong)AddFlags, box, _trackedIndices); 97 | 98 | //sw.Stop(); 99 | //Debug.Log($"Took: {sw.Elapsed.TotalMilliseconds:N8} ms"); 100 | } 101 | } 102 | 103 | void OnDisable() 104 | { 105 | if (GridManager == null) 106 | return; 107 | 108 | RestoreNodes(_touchedNodes); 109 | } 110 | 111 | private void RestoreNodes(IList previousSet, IList newSet = null) 112 | { 113 | var orphans = newSet != null 114 | ? previousSet.Except(newSet, GridPointComparer.Instance) 115 | : previousSet; 116 | 117 | foreach (var node in orphans.ToList()) 118 | { 119 | node.AddFlags(NodeFlags.AllowWalk); 120 | previousSet.Remove(node); 121 | } 122 | } 123 | 124 | public class GridPointComparer : IEqualityComparer 125 | { 126 | public static GridPointComparer Instance { get; } = new GridPointComparer(); 127 | 128 | public bool Equals(GridNode x, GridNode y) 129 | { 130 | return x.GridPoint == y.GridPoint; 131 | } 132 | 133 | public int GetHashCode(GridNode obj) 134 | { 135 | unchecked 136 | { 137 | return obj.GridPoint.X.GetHashCode() + obj.GridPoint.Y.GetHashCode() + obj.GridPoint.Z.GetHashCode(); 138 | } 139 | } 140 | } 141 | 142 | void OnDrawGizmos() 143 | { 144 | if (!ExecuteInEditMode && !Application.isPlaying) 145 | return; 146 | 147 | DrawingHelpers.DrawWireFrame(Box); 148 | } 149 | 150 | // void OnEnable() 151 | // { 152 | //#if UNITY_EDITOR 153 | // EditorApplication.playModeStateChanged += EditorApplication_playModeStateChanged; 154 | //#endif 155 | // } 156 | 157 | //#if UNITY_EDITOR 158 | // private void EditorApplication_playModeStateChanged(PlayModeStateChange state) 159 | // { 160 | // switch (state) 161 | // { 162 | // case PlayModeStateChange.ExitingEditMode: 163 | // case PlayModeStateChange.ExitingPlayMode: 164 | // EnsureDestroyed(); 165 | // break; 166 | // } 167 | // } 168 | //#endif 169 | 170 | // void OnDisable() 171 | // { 172 | //#if UNITY_EDITOR 173 | // EditorApplication.playModeStateChanged -= EditorApplication_playModeStateChanged; 174 | //#endif 175 | // GridManager = null; 176 | // } 177 | 178 | 179 | } 180 | 181 | -------------------------------------------------------------------------------- /Assets/Scripts/GridVolumeModifier.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e8ae0b00bc6023643abd0d4d7066adc6 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/NavMeshExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using BovineLabs.Entities.Helpers; 5 | using Unity.Collections; 6 | using UnityEngine; 7 | using UnityEngine.AI; 8 | using UnityEngine.Experimental.AI; 9 | 10 | public static class NavMeshExtensions 11 | { 12 | public static List Triangles = new List(); 13 | 14 | public static List OutsideEdges = new List(); 15 | 16 | private static NativeArray _outsideEdgesNative; 17 | 18 | public static ref NativeArray GetNativeEdges() 19 | { 20 | if (!_outsideEdgesNative.IsCreated) 21 | { 22 | CalculateEdges(NavMesh.CalculateTriangulation()); 23 | } 24 | return ref _outsideEdgesNative; 25 | } 26 | 27 | public struct EdgeHit 28 | { 29 | public Edge Edge; 30 | public float Distance; 31 | public Vector3 Position; 32 | public Triangle Polygon; 33 | public Bool Found; 34 | } 35 | public struct Triangle 36 | { 37 | public Edge E1; 38 | public Edge E2; 39 | public Edge E3; 40 | } 41 | 42 | public struct Edge 43 | { 44 | public Vector3 Start; 45 | public Vector3 End; 46 | 47 | public Vector3 StartUp; 48 | public Vector3 EndUp; 49 | 50 | public float Length; 51 | public Quaternion FacingNormal; 52 | public Vector3 Direction; 53 | public Vector3 Center; 54 | 55 | public static Edge FromPoints(Vector3 start, Vector3 end) 56 | { 57 | return new Edge 58 | { 59 | Start = start, 60 | End = end, 61 | Center = (end + start) / 2, 62 | Direction = (end - start).normalized, 63 | }; 64 | } 65 | 66 | public static readonly Edge Empty = new Edge(); 67 | } 68 | public static EdgeHit FindClosestEdge(NativeArray edges, Vector3 position) 69 | { 70 | var closestDist = float.MaxValue; 71 | var closestPoint = Vector3.zero; 72 | var closestEdge = Edge.Empty; 73 | 74 | foreach (var edge in edges) 75 | { 76 | var nearest = Math3d.ProjectPointOnLineSegment(edge.Start, edge.End, position); 77 | //var edgeDist = math.distance(nearest, position); 78 | 79 | // NavMesh GetTriangulation() (which this edge data is extracted from) sometimes doesn't follow the NavMesh properly 80 | // An example here: https://forum.unity.com/threads/navmesh-calculatetriangulation-produces-inaccurate-meshes.293894/ 81 | // So testing distance with XY will sync the difference on horizontal plane, then we'll need to and the test 82 | // for vertical difference or underpass/overpass areas of the nav-mesh will give false-positives. 83 | 84 | var edgeDist = FastDistanceXZ(nearest, position); 85 | if (edgeDist < closestDist) 86 | { 87 | if (Math.Abs(nearest.y-position.y) <= 0.5f) 88 | { 89 | closestPoint = nearest; 90 | closestDist = edgeDist; 91 | closestEdge = edge; 92 | } 93 | } 94 | } 95 | 96 | var result = new EdgeHit 97 | { 98 | Distance = closestDist, 99 | Position = closestPoint, 100 | Edge = closestEdge 101 | }; 102 | 103 | return result; 104 | } 105 | 106 | public static float FastDistanceXZ(Vector3 a, Vector3 b) 107 | { 108 | var xD = a.x - b.x; 109 | var zD = a.z - b.z; 110 | return (xD < 0 ? -xD : xD) + (zD < 0 ? -zD : zD); 111 | } 112 | 113 | public static float FastDistance(Vector3 a, Vector3 b) 114 | { 115 | var xD = a.x - b.x; 116 | var yD = a.y - b.y; 117 | var zD = a.z - b.z; 118 | return (xD < 0 ? -xD : xD) + (yD < 0 ? -yD : yD) + (zD < 0 ? -zD : zD); 119 | } 120 | 121 | /// 122 | /// Find the position on a line that is nearest to another point. 123 | /// 124 | /// point the line passes through 125 | /// unit vector in direction of line, either direction works 126 | /// the point to find nearest on line for 127 | /// 128 | public static Vector3 NearestPointOnLine(Vector3 testPoint, Vector3 anyPointOnLine, Vector3 lineDirectionNormalized) 129 | { 130 | var v = testPoint - anyPointOnLine; 131 | var d = Vector3.Dot(v, lineDirectionNormalized); 132 | return anyPointOnLine + lineDirectionNormalized * d; 133 | } 134 | 135 | public static void CalculateEdges(NavMeshTriangulation tr) 136 | { 137 | if(_outsideEdgesNative.IsCreated) 138 | _outsideEdgesNative.Dispose(); 139 | 140 | OutsideEdges.Clear(); 141 | Triangles.Clear(); 142 | 143 | for (int i = 0; i < tr.indices.Length - 1; i += 3) 144 | { 145 | Vector3 v1 = tr.vertices[tr.indices[i]]; 146 | Vector3 v2 = tr.vertices[tr.indices[i + 1]]; 147 | Vector3 v3 = tr.vertices[tr.indices[i + 2]]; 148 | 149 | AddOutsideEdge(v1, v2); 150 | AddOutsideEdge(v2, v3); 151 | AddOutsideEdge(v3, v1); 152 | } 153 | _outsideEdgesNative = new NativeArray(OutsideEdges.ToArray(), Allocator.Persistent); 154 | } 155 | 156 | public static unsafe ulong ReadPolygonId(this NavMeshLocation location) 157 | { 158 | return *(ulong*)&location; 159 | } 160 | 161 | public static unsafe ulong ReadPolygonId(this PolygonId location) 162 | { 163 | return *(ulong*)&location; 164 | } 165 | 166 | private static void EnsureConnectedEdges(ICollection edges) 167 | { 168 | var starts = new List(); 169 | foreach (var edge in edges) 170 | { 171 | starts.Add(edge.Start); 172 | } 173 | foreach (var edge in edges.ToList()) 174 | { 175 | if (!starts.Contains(edge.End)) 176 | edges.Remove(edge); 177 | } 178 | } 179 | 180 | public static void Dispose() 181 | { 182 | if (_outsideEdgesNative.IsCreated) 183 | { 184 | _outsideEdgesNative.Dispose(); 185 | } 186 | } 187 | 188 | private static void AddOutsideEdge( Vector3 val1, Vector3 val2) 189 | { 190 | foreach (var edge in OutsideEdges) 191 | { 192 | if (Approx(edge.Start, val1) & Approx(edge.End, val2) || Approx(edge.Start, val2) & Approx(edge.End, val1)) 193 | { 194 | OutsideEdges.Remove(edge); 195 | return; 196 | } 197 | } 198 | OutsideEdges.Add(Edge.FromPoints(val1, val2)); 199 | } 200 | 201 | public static bool Approx(Vector3 lhs, Vector3 rhs) 202 | { 203 | float num1 = lhs.x - rhs.x; 204 | float num2 = lhs.y - rhs.y; 205 | float num3 = lhs.z - rhs.z; 206 | return (double)num1 * (double)num1 + (double)num2 * (double)num2 + (double)num3 * (double)num3 < 0.01f; 207 | } 208 | 209 | } -------------------------------------------------------------------------------- /Assets/Scripts/NavMeshExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 208c4c2feb038ef488d38824efdcb1cf 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/PathTester.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 630a7850a75ceda45ba5f751084f8297 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/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73b0d9e92158061468b45de98c90354f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/Bool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BovineLabs.Entities.Helpers { 4 | /// 5 | /// Burst currently does not support so this is a simple wrapper that acts like bool. 6 | /// 7 | [Serializable] 8 | public struct Bool : IEquatable 9 | { 10 | /// 11 | /// The value of the Bool. Should only be used by serializer. 12 | /// 13 | public byte Value; 14 | 15 | /// 16 | /// Initializes a new instance of the struct. 17 | /// 18 | /// The default value. 19 | public Bool(bool value) 20 | { 21 | this.Value = value ? (byte)1 : (byte)0; 22 | } 23 | 24 | public static implicit operator Bool(bool b) 25 | { 26 | return new Bool(b); 27 | } 28 | 29 | public static implicit operator bool(Bool b) 30 | { 31 | return b.Value != 0; 32 | } 33 | 34 | /// 35 | public bool Equals(Bool other) 36 | { 37 | return this.Value == other.Value; 38 | } 39 | 40 | /// 41 | public override bool Equals(object obj) 42 | { 43 | return obj != null && obj is Bool b && this.Equals(b); 44 | } 45 | 46 | /// 47 | public override int GetHashCode() 48 | { 49 | return this.Value.GetHashCode(); 50 | } 51 | 52 | /// 53 | public override string ToString() 54 | { 55 | return (this.Value != 0).ToString(); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/Bool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b5d645adac35124986db6d244912db3 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/Utilities/DrawBoundsGizmo.cs: -------------------------------------------------------------------------------- 1 | using Unity.Mathematics; 2 | using UnityEngine; 3 | 4 | [ExecuteInEditMode] 5 | public class DrawBoundsGizmo : MonoBehaviour 6 | { 7 | [Header("Options")] 8 | public bool ShowBoundingBox = true; 9 | public bool ShowActualBox = true; 10 | public bool ShowDuringPlay = true; 11 | public bool ShowInEditor = true; 12 | 13 | [Header("Colors")] 14 | public Color BoundingBoxColor = Color.black; 15 | public Color ActualBoxColor = UnityColors.DodgerBlue; 16 | 17 | void OnDrawGizmos() 18 | { 19 | if (ShowDuringPlay && Application.isPlaying || ShowInEditor && !Application.isPlaying) 20 | { 21 | var collider = GetComponent(); 22 | if (collider == null) return; 23 | 24 | if (ShowBoundingBox) 25 | { 26 | Gizmos.color = Color.blue; 27 | Gizmos.DrawWireCube(collider.bounds.center, collider.bounds.size); 28 | } 29 | 30 | if (ShowActualBox) 31 | { 32 | var boxCollider = collider as BoxCollider; 33 | if (boxCollider != null) 34 | { 35 | Gizmos.color = BoundingBoxColor; 36 | DrawCube(boxCollider.center, boxCollider.size / 2, transform.localToWorldMatrix); 37 | } 38 | } 39 | } 40 | } 41 | 42 | private static void DrawCube(Vector3 center, Vector3 extents) 43 | { 44 | var points = GetTransformedPoints(center, extents); 45 | Gizmos.DrawLine(points[0], points[1]); 46 | Gizmos.DrawLine(points[1], points[3]); 47 | Gizmos.DrawLine(points[2], points[3]); 48 | Gizmos.DrawLine(points[2], points[0]); 49 | Gizmos.DrawLine(points[4], points[5]); 50 | Gizmos.DrawLine(points[5], points[7]); 51 | Gizmos.DrawLine(points[6], points[7]); 52 | Gizmos.DrawLine(points[6], points[4]); 53 | Gizmos.DrawLine(points[0], points[4]); 54 | Gizmos.DrawLine(points[1], points[5]); 55 | Gizmos.DrawLine(points[2], points[6]); 56 | Gizmos.DrawLine(points[3], points[7]); 57 | } 58 | 59 | public static Vector3[] GetTransformedPoints(Vector3 center, Vector3 extents) => new[] 60 | { 61 | center + new Vector3(extents.x, extents.y, extents.z), 62 | center + new Vector3(extents.x, extents.y, -extents.z), 63 | center + new Vector3(extents.x, -extents.y, extents.z), 64 | center + new Vector3(extents.x, -extents.y, -extents.z), 65 | center + new Vector3(-extents.x, extents.y, extents.z), 66 | center + new Vector3(-extents.x, extents.y, -extents.z), 67 | center + new Vector3(-extents.x, -extents.y, extents.z), 68 | center + new Vector3(-extents.x, -extents.y, -extents.z), 69 | }; 70 | 71 | private static void DrawCube(Vector3 center, Vector3 extents, float4x4 matrix) 72 | { 73 | var points = GetTransformedPoints(center, extents, matrix); 74 | Gizmos.DrawLine(points[0], points[1]); 75 | Gizmos.DrawLine(points[1], points[3]); 76 | Gizmos.DrawLine(points[2], points[3]); 77 | Gizmos.DrawLine(points[2], points[0]); 78 | Gizmos.DrawLine(points[4], points[5]); 79 | Gizmos.DrawLine(points[5], points[7]); 80 | Gizmos.DrawLine(points[6], points[7]); 81 | Gizmos.DrawLine(points[6], points[4]); 82 | Gizmos.DrawLine(points[0], points[4]); 83 | Gizmos.DrawLine(points[1], points[5]); 84 | Gizmos.DrawLine(points[2], points[6]); 85 | Gizmos.DrawLine(points[3], points[7]); 86 | } 87 | 88 | public static float3[] GetTransformedPoints(Vector3 center, Vector3 extents, float4x4 matrix) => new[] 89 | { 90 | math.transform(matrix, center + new Vector3(extents.x, extents.y, extents.z)), 91 | math.transform(matrix, center + new Vector3(extents.x, extents.y, -extents.z)), 92 | math.transform(matrix, center + new Vector3(extents.x, -extents.y, extents.z)), 93 | math.transform(matrix, center + new Vector3(extents.x, -extents.y, -extents.z)), 94 | math.transform(matrix, center + new Vector3(-extents.x, extents.y, extents.z)), 95 | math.transform(matrix, center + new Vector3(-extents.x, extents.y, -extents.z)), 96 | math.transform(matrix, center + new Vector3(-extents.x, -extents.y, extents.z)), 97 | math.transform(matrix, center + new Vector3(-extents.x, -extents.y, -extents.z)), 98 | }; 99 | 100 | 101 | 102 | 103 | 104 | } 105 | 106 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/DrawBoundsGizmo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5e04b715ffd36d4cb1762e96cfeaa7a 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/Utilities/Math3D.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 003738991df10074fba417dc02c7572c 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/Utilities/NavMeshAreasGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43c96ab41c8d3ac419eb60e00681b6c7 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/Utilities/RotateAround.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class RotateAround : MonoBehaviour 4 | { 5 | public Vector3 RotationMask = new Vector3(0, 1, 0); //which axes to rotate around 6 | public float RotationSpeed = 5.0f; //degrees per second 7 | public Transform RotateAroundObject; 8 | 9 | void Update() 10 | { 11 | if (RotateAroundObject != null) 12 | { 13 | transform.RotateAround(RotateAroundObject.transform.position, 14 | RotationMask, RotationSpeed * Time.deltaTime); 15 | } 16 | else 17 | { 18 | transform.Rotate(new Vector3( 19 | RotationMask.x * RotationSpeed * Time.deltaTime, 20 | RotationMask.y * RotationSpeed * Time.deltaTime, 21 | RotationMask.z * RotationSpeed * Time.deltaTime)); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Scripts/Utilities/RotateAround.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e86f4f3f4430834abe67dc29de003ac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jeffrey Vella 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.collab-proxy": "1.2.16", 4 | "com.unity.ide.rider": "1.1.4", 5 | "com.unity.ide.vscode": "1.1.4", 6 | "com.unity.jobs": "0.2.9-preview.15", 7 | "com.unity.test-framework": "1.1.11", 8 | "com.unity.textmeshpro": "2.0.1", 9 | "com.unity.timeline": "1.2.13", 10 | "com.unity.ugui": "1.0.0", 11 | "com.unity.modules.ai": "1.0.0", 12 | "com.unity.modules.androidjni": "1.0.0", 13 | "com.unity.modules.animation": "1.0.0", 14 | "com.unity.modules.assetbundle": "1.0.0", 15 | "com.unity.modules.audio": "1.0.0", 16 | "com.unity.modules.cloth": "1.0.0", 17 | "com.unity.modules.director": "1.0.0", 18 | "com.unity.modules.imageconversion": "1.0.0", 19 | "com.unity.modules.imgui": "1.0.0", 20 | "com.unity.modules.jsonserialize": "1.0.0", 21 | "com.unity.modules.particlesystem": "1.0.0", 22 | "com.unity.modules.physics": "1.0.0", 23 | "com.unity.modules.physics2d": "1.0.0", 24 | "com.unity.modules.screencapture": "1.0.0", 25 | "com.unity.modules.terrain": "1.0.0", 26 | "com.unity.modules.terrainphysics": "1.0.0", 27 | "com.unity.modules.tilemap": "1.0.0", 28 | "com.unity.modules.ui": "1.0.0", 29 | "com.unity.modules.uielements": "1.0.0", 30 | "com.unity.modules.umbra": "1.0.0", 31 | "com.unity.modules.unityanalytics": "1.0.0", 32 | "com.unity.modules.unitywebrequest": "1.0.0", 33 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 34 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 35 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 36 | "com.unity.modules.unitywebrequestwww": "1.0.0", 37 | "com.unity.modules.vehicles": "1.0.0", 38 | "com.unity.modules.video": "1.0.0", 39 | "com.unity.modules.vr": "1.0.0", 40 | "com.unity.modules.wind": "1.0.0", 41 | "com.unity.modules.xr": "1.0.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /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: 12 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 18 | m_ClothInterCollisionStiffness: 0 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_DefaultMaxAngluarSpeed: 7 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: 7 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;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 0 24 | m_EnableTextureStreamingInPlayMode: 1 25 | -------------------------------------------------------------------------------- /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 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /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.05 77 | agentHeight: 2 78 | agentSlope: 60 79 | agentClimb: 0.5 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/ProBuilderSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "m_Dictionary": { 3 | "m_DictionaryValues": [ 4 | { 5 | "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 6 | "key": "about.identifier", 7 | "value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":0,\"m_Patch\":0,\"m_Build\":39,\"m_Type\":\"preview\",\"m_Metadata\":\"\",\"m_Date\":\"2019/01/07\"}}" 8 | }, 9 | { 10 | "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 11 | "key": "preferences.version", 12 | "value": "{\"m_Value\":{\"m_Major\":4,\"m_Minor\":0,\"m_Patch\":0,\"m_Build\":39,\"m_Type\":\"preview\",\"m_Metadata\":\"\",\"m_Date\":\"2019/01/07\"}}" 13 | }, 14 | { 15 | "type": "UnityEngine.ProBuilder.LogLevel, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 16 | "key": "log.level", 17 | "value": "{\"m_Value\":3}" 18 | }, 19 | { 20 | "type": "UnityEngine.ProBuilder.LogOutput, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 21 | "key": "log.output", 22 | "value": "{\"m_Value\":1}" 23 | }, 24 | { 25 | "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 26 | "key": "log.path", 27 | "value": "{\"m_Value\":\"ProBuilderLog.txt\"}" 28 | }, 29 | { 30 | "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 31 | "key": "VertexColorPalette.previousColorPalette", 32 | "value": "{\"m_Value\":\"Assets/ProBuilder Data/Default Color Palette.asset\"}" 33 | }, 34 | { 35 | "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 36 | "key": "editor.materialPalettePath", 37 | "value": "{\"m_Value\":\"Assets/ProBuilder Data//Default Material Palette.asset\"}" 38 | }, 39 | { 40 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 41 | "key": "UnityEngine.ProBuilder.ProBuilderEditor-isUtilityWindow", 42 | "value": "{\"m_Value\":false}" 43 | }, 44 | { 45 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 46 | "key": "editor.backFaceSelectEnabled", 47 | "value": "{\"m_Value\":false}" 48 | }, 49 | { 50 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 51 | "key": "editor.toolbarIconGUI", 52 | "value": "{\"m_Value\":false}" 53 | }, 54 | { 55 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 56 | "key": "editor.showSceneInfo", 57 | "value": "{\"m_Value\":false}" 58 | }, 59 | { 60 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 61 | "key": "mesh.newShapesSnapToGrid", 62 | "value": "{\"m_Value\":true}" 63 | }, 64 | { 65 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 66 | "key": "lightmapping.autoUnwrapLightmapUV", 67 | "value": "{\"m_Value\":true}" 68 | }, 69 | { 70 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 71 | "key": "editor.autoRecalculateCollisions", 72 | "value": "{\"m_Value\":false}" 73 | }, 74 | { 75 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 76 | "key": "experimental.meshesAreAssets", 77 | "value": "{\"m_Value\":false}" 78 | }, 79 | { 80 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 81 | "key": "mesh.meshColliderIsConvex", 82 | "value": "{\"m_Value\":false}" 83 | }, 84 | { 85 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 86 | "key": "editor.showEditorNotifications", 87 | "value": "{\"m_Value\":false}" 88 | }, 89 | { 90 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 91 | "key": "editor.closeWindowAfterShapeCreation", 92 | "value": "{\"m_Value\":false}" 93 | }, 94 | { 95 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 96 | "key": "FillHole.selectEntirePath", 97 | "value": "{\"m_Value\":true}" 98 | }, 99 | { 100 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 101 | "key": "entity.detailVisible", 102 | "value": "{\"m_Value\":true}" 103 | }, 104 | { 105 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 106 | "key": "entity.moverVisible", 107 | "value": "{\"m_Value\":true}" 108 | }, 109 | { 110 | "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 111 | "key": "SelectVertexColor.restrictToSelectedObjects", 112 | "value": "{\"m_Value\":false}" 113 | }, 114 | { 115 | "type": "UnityEngine.ProBuilder.SelectionModifierBehavior, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 116 | "key": "editor.rectSelectModifier", 117 | "value": "{\"m_Value\":2}" 118 | }, 119 | { 120 | "type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 121 | "key": "editor.dragSelectRectMode", 122 | "value": "{\"m_Value\":0}" 123 | }, 124 | { 125 | "type": "UnityEngine.ProBuilder.Shortcut[], Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 126 | "key": "editor.sceneViewShortcuts", 127 | "value": "{}" 128 | }, 129 | { 130 | "type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 131 | "key": "editor.selectMode", 132 | "value": "{\"m_Value\":1}" 133 | }, 134 | { 135 | "type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 136 | "key": "mesh.newShapePivotLocation", 137 | "value": "{\"m_Value\":1}" 138 | }, 139 | { 140 | "type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 141 | "key": "mesh.shadowCastingMode", 142 | "value": "{\"m_Value\":1}" 143 | }, 144 | { 145 | "type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 146 | "key": "mesh.userMaterial", 147 | "value": "{\"m_Value\":{\"instanceID\":0}}" 148 | }, 149 | { 150 | "type": "UnityEditor.StaticEditorFlags, UnityEditor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 151 | "key": "mesh.defaultStaticEditorFlags", 152 | "value": "{\"m_Value\":0}" 153 | }, 154 | { 155 | "type": "UnityEngine.ProBuilder.ColliderType, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 156 | "key": "mesh.newShapeColliderType", 157 | "value": "{\"m_Value\":2}" 158 | }, 159 | { 160 | "type": "UnityEngine.ProBuilder.UnwrapParameters, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 161 | "key": "lightmapping.defaultLightmapUnwrapParameters", 162 | "value": "{\"m_Value\":{\"m_HardAngle\":88.0,\"m_PackMargin\":20.0,\"m_AngleError\":8.0,\"m_AreaError\":15.0}}" 163 | }, 164 | { 165 | "type": "UnityEngine.ProBuilder.ExtrudeMethod, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 166 | "key": "editor.extrudeMethod", 167 | "value": "{\"m_Value\":2}" 168 | }, 169 | { 170 | "type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 171 | "key": "ExtrudeFaces.distance", 172 | "value": "{\"m_Value\":1.0}" 173 | }, 174 | { 175 | "type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 176 | "key": "BevelEdges.size", 177 | "value": "{\"m_Value\":0.20000000298023225}" 178 | } 179 | ] 180 | } 181 | } -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.3.6f1 2 | m_EditorVersionWithRevision: 2019.3.6f1 (5c3fb0a11183) 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 | blendWeights: 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 | blendWeights: 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 | blendWeights: 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 | blendWeights: 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 | blendWeights: 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 | blendWeights: 4 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 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Standalone: 5 227 | WebGL: 3 228 | Windows Store Apps: 5 229 | XboxOne: 5 230 | iPhone: 2 231 | tvOS: 2 232 | -------------------------------------------------------------------------------- /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 | # UnityAStarNavigation 2 | 3 | An experimental 3D A* navigation system for Unity using burst compiled jobs. 4 | 5 | ##### Features: 6 | 7 | * 3D A* Pathfinding queries. 8 | * Custom Native 3D dense grid ontop of a single NativeArray 9 | * Each query can specify its own area weights. 10 | * Grid nodes can be assigned to many areas. 11 | * Grid nodes can be added/removed from areas by volume with oriented bounding boxes. 12 | * Grid nodes can be generated for terrain by mapping to a Unity NavMesh. 13 | * Custom NativePriorityQueue 14 | 15 | 16 | 17 | Note: Project was created with Unity 2019.3, older versions may not work. 18 | --------------------------------------------------------------------------------