Large diffs are not rendered by default.

Large diffs are not rendered by default.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Navmesh
m_Shader: {fileID: 4800000, guid: 6dad35c0b62e44c26ab244ad80deee1a, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DecalTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Scale
second: -2.68000007
data:
first:
name: _Shininess
second: .699999988
data:
first:
name: _InvFade
second: 1
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: .209000006}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _Emission
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Tint
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _FadeColor
second: {r: .654411793, g: .654411793, b: .654411793, a: .0588235296}
data:
first:
name: _TintColor
second: {r: .5, g: .5, b: .5, a: .5}
data:
first:
name: _EmisColor
second: {r: .200000003, g: .200000003, b: .200000003, a: 0}
data:
first:
name: _Amb
second: {r: 0, g: 1, b: .33381772, a: 1}
data:
first:
name: _Low
second: {r: 1, g: 1, b: 1, a: .699999988}
data:
first:
name: _Emmission
second: {r: .474489808, g: .474489808, b: .474489808, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
@@ -0,0 +1,128 @@
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Hidden/AstarPathfindingProject/Navmesh" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0.5)
_MainTex ("Texture", 2D) = "white" { }
_Scale ("Scale", float) = 1
_FadeColor ("Fade Color", Color) = (1,1,1,0.3)
}
SubShader {

Pass {
ColorMask 0
}

Tags {"Queue"="Transparent+1" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200



Offset -2, -20
Cull Off
Lighting On

Pass {
ZWrite Off
ZTest Greater
Blend SrcAlpha OneMinusSrcAlpha

CGPROGRAM
#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"

sampler2D _MainTex;
float _Scale;
float4 _FadeColor;

struct appdata_color {
float4 vertex : POSITION;
fixed4 color : COLOR;
};

struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
half4 col : COLOR;
};

float4 _MainTex_ST;

v2f vert (appdata_color v) {
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);

float4 worldSpace = mul (unity_ObjectToWorld, v.vertex);
o.uv = float2 (worldSpace.x*_Scale,worldSpace.z*_Scale);
o.col = v.color*_FadeColor;
return o;
}

half4 frag (v2f i) : COLOR {
half4 texcol = tex2D (_MainTex, i.uv) * i.col;
//texcol.a = 0.1;
return texcol;
}
ENDCG

}

ZWrite Off
Pass {
ZTest LEqual
//Blend One One Fog { Color (0,0,0,0) }

Blend SrcAlpha OneMinusSrcAlpha

ZWrite Off

CGPROGRAM
#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"

float4 _Color;
sampler2D _MainTex;
float _Scale;

struct appdata_color {
float4 vertex : POSITION;
fixed4 color : COLOR;
};

struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
half4 col : COLOR;
};

v2f vert (appdata_color v)
{
v2f o;
o.pos = UnityObjectToClipPos (v.vertex);

float4 worldSpace = mul (unity_ObjectToWorld, v.vertex);
o.uv = float2 (worldSpace.x*_Scale,worldSpace.z*_Scale);
o.col = v.color;
return o;
}

half4 frag (v2f i) : COLOR
{
//glBlendFunc = GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
half4 texcol = tex2D (_MainTex, i.uv) * i.col;
//texcol.a = 0.1;
return texcol * _Color;
}
ENDCG

}


}
Fallback "VertexLit"
}
@@ -0,0 +1,95 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: NavmeshOutline
m_Shader: {fileID: 4800000, guid: 6c78a6dd468954643a87ebf0014bc305, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
data:
first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 0ff27a4aaa0ce4d1ba6a39ce3c868a76, type: 3}
m_Scale: {x: 2, y: 2}
m_Offset: {x: 0, y: 0}
data:
first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
data:
first:
name: _DecalTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
data:
first:
name: _Scale
second: -2.68000007
data:
first:
name: _Shininess
second: .699999988
data:
first:
name: _InvFade
second: 1
m_Colors:
data:
first:
name: _Color
second: {r: 1, g: 1, b: 1, a: .209000006}
data:
first:
name: _SpecColor
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _Emission
second: {r: 0, g: 0, b: 0, a: 1}
data:
first:
name: _Tint
second: {r: 1, g: 1, b: 1, a: 1}
data:
first:
name: _FadeColor
second: {r: .654411793, g: .654411793, b: .654411793, a: .0588235296}
data:
first:
name: _TintColor
second: {r: .5, g: .5, b: .5, a: .5}
data:
first:
name: _EmisColor
second: {r: .200000003, g: .200000003, b: .200000003, a: 0}
data:
first:
name: _Amb
second: {r: 0, g: 1, b: .33381772, a: 1}
data:
first:
name: _Low
second: {r: 1, g: 1, b: 1, a: .699999988}
data:
first:
name: _Emmission
second: {r: .474489808, g: .474489808, b: .474489808, a: 1}
--- !u!1002 &2100001
EditorExtensionImpl:
serializedVersion: 6
@@ -0,0 +1,71 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Hidden/AstarPathfindingProject/Navmesh Outline" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0.5)
_MainTex ("Texture", 2D) = "white" { }
_Scale ("Scale", float) = 1
_FadeColor ("Fade Color", Color) = (1,1,1,0.3)
}
SubShader {

Pass {
ZTest LEqual
Lighting Off
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
Offset -2, -50

CGPROGRAM
#pragma vertex vert
#pragma fragment frag

float4 _Color;
sampler2D _MainTex;
float _Scale;

struct appdata_color {
float4 vertex : POSITION;
fixed4 color : COLOR;
float4 normal : NORMAL;
};

struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
half4 col : COLOR;
};

v2f vert (appdata_color v) {
v2f o;
float4 p1 = UnityObjectToClipPos(v.vertex);
float4 p2 = UnityObjectToClipPos(v.vertex + v.normal);
float4 p1s = p1/p1.w;
float4 p2s = p2/p2.w;

float4 delta = p2s - p1s;
float2 screenSpaceNormal = float2(-delta.y, delta.x);
screenSpaceNormal = normalize(screenSpaceNormal) / _ScreenParams.xy;
float4 sn = float4(screenSpaceNormal.x, screenSpaceNormal.y, 0, 0) * (v.color.a-0.5);
o.pos = p1s + sn*8;

// Multiply by w because homogeneous coordinates
o.pos *= p1.w;

o.col = v.color;
o.col.a = 1;
o.uv = float2(v.color.a, 0);
return o;
}

half4 frag (v2f i) : COLOR {
return tex2D(_MainTex, i.uv) * i.col;
}
ENDCG

}


}
Fallback "None"
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -3,7 +3,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using PathFinding.NavGraph;
using PathFinding.Graph3d;


namespace PathFinding
@@ -1,7 +1,7 @@

using UnityEngine;
using UnityEditor;
using PathFinding.NavGraph;
using PathFinding.Graph3d;


namespace PathFinding

Large diffs are not rendered by default.

@@ -3,7 +3,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using PathFinding.NavGraph;
using PathFinding.Graph3d;


namespace PathFinding

Large diffs are not rendered by default.

@@ -27,12 +27,21 @@ public static void ShowWindow3DGrid()
}


[MenuItem(@"Tools/Navgation/Nav Mesh")]
/*[MenuItem(@"Tools/Navgation/Nav Mesh")]
public static void ShowWindowNavMeshEditor()
{
Rect wr = new Rect(100, 100, 400, 300);
var window = (NavMeshEditor)EditorWindow.GetWindowWithRect(typeof(NavMeshEditor), wr, true, "Nav Mesh Editor");
window.Show();
}*/


[MenuItem(@"Tools/Navgation/Nav Mesh")]
public static void ShowWindowNavMeshEditor()
{
Rect wr = new Rect(100, 100, 400, 300);
var window = (RecastGraphEditor)EditorWindow.GetWindowWithRect(typeof(RecastGraphEditor), wr, true, "Recast Nav Mesh");
window.Show();
}

}
@@ -3,7 +3,7 @@
using UnityEngine;


namespace PathFinding.NavGraph
namespace PathFinding.Graph3d
{

public class Cell
@@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using PathFinding.NavGraph;
using PathFinding.Graph3d;


namespace PathFinding
@@ -2,7 +2,7 @@

using UnityEngine;
using System.Collections.Generic;
using PathFinding.NavGraph;
using PathFinding.Graph3d;


namespace PathFinding
@@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;

namespace Pathfinding {
namespace PathFinding {
/** Contains various spline functions.
* \ingroup utils
*/
@@ -1504,7 +1504,7 @@ public static class Polygon {
public static Vector3[] ConvexHullXZ (Vector3[] points) {
if (points.Length == 0) return new Vector3[0];

var hull = Pathfinding.Util.ListPool<Vector3>.Claim();
var hull = PathFinding.Util.ListPool<Vector3>.Claim();

int pointOnHull = 0;
for (int i = 1; i < points.Length; i++) if (points[i].x < points[pointOnHull].x) pointOnHull = i;
@@ -1529,7 +1529,7 @@ public static class Polygon {
var result = hull.ToArray();

// Return to pool
Pathfinding.Util.ListPool<Vector3>.Release(hull);
PathFinding.Util.ListPool<Vector3>.Release(hull);
return result;
}

@@ -1,7 +1,8 @@
using UnityEngine;
using System.Collections.Generic;

namespace Pathfinding {
namespace PathFinding
{
/** GraphModifier is used for modifying graphs or processing graph data based on events.
* This class is a simple container for a number of events.
*
@@ -10,7 +11,8 @@ namespace Pathfinding {
* \see Application.IsPlaying
*/
[ExecuteInEditMode]
public abstract class GraphModifier : MonoBehaviour {
public abstract class GraphModifier : MonoBehaviour
{
/** All active graph modifiers */
private static GraphModifier root;

@@ -25,28 +27,33 @@ public abstract class GraphModifier : MonoBehaviour {
/** Maps persistent IDs to the component that uses it */
protected static Dictionary<ulong, GraphModifier> usedIDs = new Dictionary<ulong, GraphModifier>();

protected static List<T> GetModifiersOfType<T>() where T : GraphModifier {
protected static List<T> GetModifiersOfType<T>() where T : GraphModifier
{
var obj = root;
var ls = new List<T>();

while (obj != null) {
while (obj != null)
{
var cast = obj as T;
if (cast != null) ls.Add(cast);
obj = obj.next;
}
return ls;
}

public static void FindAllModifiers () {
public static void FindAllModifiers()
{
var arr = FindObjectsOfType(typeof(GraphModifier)) as GraphModifier[];

for (int i = 0; i < arr.Length; i++) {
for (int i = 0; i < arr.Length; i++)
{
if (arr[i].enabled) arr[i].OnEnable();
}
}

/** GraphModifier event type */
public enum EventType {
public enum EventType
{
PostScan = 1 << 0,
PreScan = 1 << 1,
LatePostScan = 1 << 2,
@@ -56,85 +63,102 @@ public enum EventType {
}

/** Triggers an event for all active graph modifiers */
public static void TriggerEvent (GraphModifier.EventType type) {
if (!Application.isPlaying) {
public static void TriggerEvent(GraphModifier.EventType type)
{
if (!Application.isPlaying)
{
FindAllModifiers();
}

GraphModifier c = root;
switch (type) {
case EventType.PreScan:
while (c != null) { c.OnPreScan(); c = c.next; }
break;
case EventType.PostScan:
while (c != null) { c.OnPostScan(); c = c.next; }
break;
case EventType.LatePostScan:
while (c != null) { c.OnLatePostScan(); c = c.next; }
break;
case EventType.PreUpdate:
while (c != null) { c.OnGraphsPreUpdate(); c = c.next; }
break;
case EventType.PostUpdate:
while (c != null) { c.OnGraphsPostUpdate(); c = c.next; }
break;
case EventType.PostCacheLoad:
while (c != null) { c.OnPostCacheLoad(); c = c.next; }
break;
switch (type)
{
case EventType.PreScan:
while (c != null) { c.OnPreScan(); c = c.next; }
break;
case EventType.PostScan:
while (c != null) { c.OnPostScan(); c = c.next; }
break;
case EventType.LatePostScan:
while (c != null) { c.OnLatePostScan(); c = c.next; }
break;
case EventType.PreUpdate:
while (c != null) { c.OnGraphsPreUpdate(); c = c.next; }
break;
case EventType.PostUpdate:
while (c != null) { c.OnGraphsPostUpdate(); c = c.next; }
break;
case EventType.PostCacheLoad:
while (c != null) { c.OnPostCacheLoad(); c = c.next; }
break;
}
}

/** Adds this modifier to list of active modifiers */
protected virtual void OnEnable () {
protected virtual void OnEnable()
{
RemoveFromLinkedList();
AddToLinkedList();
ConfigureUniqueID();
}

/** Removes this modifier from list of active modifiers */
protected virtual void OnDisable () {
protected virtual void OnDisable()
{
RemoveFromLinkedList();
}

protected virtual void Awake () {
protected virtual void Awake()
{
ConfigureUniqueID();
}

void ConfigureUniqueID () {
void ConfigureUniqueID()
{
// Check if any other object is using the same uniqueID
// In that case this object may have been duplicated
GraphModifier usedBy;

if (usedIDs.TryGetValue(uniqueID, out usedBy) && usedBy != this) {
if (usedIDs.TryGetValue(uniqueID, out usedBy) && usedBy != this)
{
Reset();
}

usedIDs[uniqueID] = this;
}

void AddToLinkedList () {
if (root == null) {
void AddToLinkedList()
{
if (root == null)
{
root = this;
} else {
}
else
{
next = root;
root.prev = this;
root = this;
}
}

void RemoveFromLinkedList () {
if (root == this) {
void RemoveFromLinkedList()
{
if (root == this)
{
root = next;
if (root != null) root.prev = null;
} else {
}
else
{
if (prev != null) prev.next = next;
if (next != null) next.prev = prev;
}
prev = null;
next = null;
}

protected virtual void OnDestroy () {
protected virtual void OnDestroy()
{
usedIDs.Remove(uniqueID);
}

@@ -150,7 +174,7 @@ public enum EventType {
*
* \see OnLatePostScan
*/
public virtual void OnPostScan () {}
public virtual void OnPostScan() { }

/** Called right before graphs are going to be scanned.
*
@@ -163,28 +187,29 @@ public enum EventType {
*
* \see OnLatePostScan
* */
public virtual void OnPreScan () {}
public virtual void OnPreScan() { }

/** Called at the end of the scanning procedure.
* This is the absolute last thing done by Scan.
*
*/
public virtual void OnLatePostScan () {}
public virtual void OnLatePostScan() { }

/** Called after cached graphs have been loaded.
* When using cached startup, this event is analogous to OnLatePostScan and implementing scripts
* should do roughly the same thing for both events.
*/
public virtual void OnPostCacheLoad () {}
public virtual void OnPostCacheLoad() { }

/** Called before graphs are updated using GraphUpdateObjects */
public virtual void OnGraphsPreUpdate () {}
public virtual void OnGraphsPreUpdate() { }

/** Called after graphs have been updated using GraphUpdateObjects.
* Eventual flood filling has been done */
public virtual void OnGraphsPostUpdate () {}
public virtual void OnGraphsPostUpdate() { }

void Reset () {
void Reset()
{
// Create a new random 64 bit value (62 bit actually because we skip negative numbers, but that's still enough by a huge margin)
uniqueID = (ulong)Random.Range(0, int.MaxValue) | ((ulong)Random.Range(0, int.MaxValue) << 32);
usedIDs[uniqueID] = this;
@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;

namespace Pathfinding.Util {
namespace PathFinding.Util {
/** Lightweight List Pool.
* Handy class for pooling lists of type T.
*
@@ -1,12 +1,12 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Pathfinding;
using PathFinding;
#if UNITY_EDITOR
using UnityEditor;
#endif

namespace Pathfinding
namespace PathFinding
{
public class NodeLink3Node : PointNode
{
@@ -2,7 +2,7 @@
using System.Collections.Generic;


namespace Pathfinding
namespace PathFinding
{
public delegate void GraphNodeDelegate(GraphNode node);
public delegate bool GraphNodeDelegateCancelable(GraphNode node);
@@ -1,14 +1,14 @@
using UnityEngine;
using System.Collections.Generic;
using Pathfinding;
using PathFinding;

// Empty namespace declaration to avoid errors in the free version
// Which does not have any classes in the RVO namespace
namespace Pathfinding.RVO { }
namespace PathFinding.RVO { }

namespace Pathfinding
namespace PathFinding
{
using Pathfinding.Util;
using PathFinding.Util;

#if UNITY_5_0
/** Used in Unity 5.0 since the HelpURLAttribute was first added in Unity 5.1 */
@@ -2,7 +2,7 @@
using System.Collections.Generic;


namespace Pathfinding
namespace PathFinding
{
/** Base class for all graphs */
public abstract class NavGraph
@@ -2,7 +2,7 @@
using System.Collections.Generic;


namespace Pathfinding
namespace PathFinding
{
public interface INavmesh
{
@@ -460,8 +460,8 @@ public static bool Linecast(INavmesh graph, Vector3 tmp_origin, Vector3 tmp_end,
}


List<Vector3> left = Pathfinding.Util.ListPool<Vector3>.Claim();//new List<Vector3>(1);
List<Vector3> right = Pathfinding.Util.ListPool<Vector3>.Claim();//new List<Vector3>(1);
List<Vector3> left = PathFinding.Util.ListPool<Vector3>.Claim();//new List<Vector3>(1);
List<Vector3> right = PathFinding.Util.ListPool<Vector3>.Claim();//new List<Vector3>(1);

int counter = 0;
while (true)
@@ -470,8 +470,8 @@ public static bool Linecast(INavmesh graph, Vector3 tmp_origin, Vector3 tmp_end,
if (counter > 2000)
{
Debug.LogError("Linecast was stuck in infinite loop. Breaking.");
Pathfinding.Util.ListPool<Vector3>.Release(left);
Pathfinding.Util.ListPool<Vector3>.Release(right);
PathFinding.Util.ListPool<Vector3>.Release(left);
PathFinding.Util.ListPool<Vector3>.Release(right);
return true;
}

@@ -481,8 +481,8 @@ public static bool Linecast(INavmesh graph, Vector3 tmp_origin, Vector3 tmp_end,

if (node.ContainsPoint(end))
{
Pathfinding.Util.ListPool<Vector3>.Release(left);
Pathfinding.Util.ListPool<Vector3>.Release(right);
PathFinding.Util.ListPool<Vector3>.Release(left);
PathFinding.Util.ListPool<Vector3>.Release(right);
return false;
}

@@ -560,8 +560,8 @@ public static bool Linecast(INavmesh graph, Vector3 tmp_origin, Vector3 tmp_end,
hit.tangent = b - a;
hit.tangentOrigin = a;

Pathfinding.Util.ListPool<Vector3>.Release(left);
Pathfinding.Util.ListPool<Vector3>.Release(right);
PathFinding.Util.ListPool<Vector3>.Release(left);
PathFinding.Util.ListPool<Vector3>.Release(right);
return true;
}
}
@@ -570,8 +570,8 @@ public static bool Linecast(INavmesh graph, Vector3 tmp_origin, Vector3 tmp_end,
//Ok, this is wrong...
Debug.LogWarning("Linecast failing because point not inside node, and line does not hit any edges of it");

Pathfinding.Util.ListPool<Vector3>.Release(left);
Pathfinding.Util.ListPool<Vector3>.Release(right);
PathFinding.Util.ListPool<Vector3>.Release(left);
PathFinding.Util.ListPool<Vector3>.Release(right);
return false;
}

@@ -1,7 +1,7 @@
using UnityEngine;


namespace Pathfinding
namespace PathFinding
{
public class PointNode : GraphNode
{
@@ -1,7 +1,7 @@
using UnityEngine;


namespace Pathfinding
namespace PathFinding
{
public interface INavmeshHolder
{
@@ -85,7 +85,7 @@ public override Vector3 ClosestPointOnNode(Vector3 p)
{
INavmeshHolder g = GetNavmeshHolder(GraphIndex);

return Pathfinding.Polygon.ClosestPointOnTriangle((Vector3)g.GetVertex(v0), (Vector3)g.GetVertex(v1), (Vector3)g.GetVertex(v2), p);
return PathFinding.Polygon.ClosestPointOnTriangle((Vector3)g.GetVertex(v0), (Vector3)g.GetVertex(v1), (Vector3)g.GetVertex(v2), p);
}

public override Vector3 ClosestPointOnNodeXZ(Vector3 p)
@@ -4,9 +4,9 @@
using UnityEngine;
using System.Collections.Generic;

namespace Pathfinding
namespace PathFinding
{
using Pathfinding.Voxels;
using PathFinding.Voxels;


public class RecastGraph : NavGraph, INavmesh, IRaycastableGraph, IUpdatableGraph, INavmeshHolder
@@ -1462,8 +1462,8 @@ NavmeshTile CreateTile(Voxelize vox, VoxelMesh mesh, int x, int z)
*/
void CreateNodeConnections(TriangleMeshNode[] nodes)
{
List<MeshNode> connections = Pathfinding.Util.ListPool<MeshNode>.Claim();
List<uint> connectionCosts = Pathfinding.Util.ListPool<uint>.Claim();
List<MeshNode> connections = PathFinding.Util.ListPool<MeshNode>.Claim();
List<uint> connectionCosts = PathFinding.Util.ListPool<uint>.Claim();

Dictionary<Int2, int> nodeRefs = cachedInt2_int_dict;
nodeRefs.Clear();
@@ -1528,8 +1528,8 @@ void CreateNodeConnections(TriangleMeshNode[] nodes)
node.connectionCosts = connectionCosts.ToArray();
}

Pathfinding.Util.ListPool<MeshNode>.Release(connections);
Pathfinding.Util.ListPool<uint>.Release(connectionCosts);
PathFinding.Util.ListPool<MeshNode>.Release(connections);
PathFinding.Util.ListPool<uint>.Release(connectionCosts);
}

/** Generate connections between the two tiles.
@@ -1,6 +1,6 @@
using System;

namespace Pathfinding.Util {
namespace PathFinding.Util {
public static class Memory {
/** Sets all values in an array to a specific value faster than a loop.
* Only faster for large arrays. Slower for small ones.
@@ -3,8 +3,8 @@
using System;
using UnityEngine;

namespace Pathfinding {
using Pathfinding;
namespace PathFinding {
using PathFinding;

/** Axis Aligned Bounding Box Tree.
* Holds a bounding box tree of triangles.
@@ -14,7 +14,7 @@
//using MarkerMetro.Unity.WinLegacy.IO;
#endif

namespace Pathfinding {
namespace PathFinding {
public class ObjImporter {
private struct meshStruct {
public Vector3[] vertices;
@@ -2,7 +2,7 @@
using UnityEngine;
using System.Collections.Generic;

namespace Pathfinding {
namespace PathFinding {
/** Axis Aligned Bounding Box Tree.
* Holds a bounding box tree of RecastMeshObj components.\n
* Note that it assumes that once an object has been added, it stays at the same
@@ -1,7 +1,7 @@
using UnityEngine;
using System.Collections.Generic;

namespace Pathfinding {
namespace PathFinding {
/** Explicit mesh object for recast graphs.
* Adding this component to an object will make sure it is included in any recast graphs.
* It will be included even though the Rasterize Meshes toggle is set to false.