Adding A* Algorythm and carpet roads

This commit is contained in:
Nicolas SANS
2023-04-24 15:49:03 +02:00
parent 75018ee6cd
commit 690e3fbd0b
685 changed files with 134125 additions and 19 deletions

View File

@ -0,0 +1,34 @@
using UnityEditor;
namespace Pathfinding {
[CustomEditor(typeof(RaycastModifier))]
[CanEditMultipleObjects]
public class RaycastModifierEditor : EditorBase {
protected override void Inspector () {
PropertyField("quality");
if (PropertyField("useRaycasting", "Use Physics Raycasting")) {
EditorGUI.indentLevel++;
PropertyField("use2DPhysics");
if (PropertyField("thickRaycast")) {
EditorGUI.indentLevel++;
FloatField("thickRaycastRadius", min: 0f);
EditorGUI.indentLevel--;
}
PropertyField("raycastOffset");
PropertyField("mask", "Layer Mask");
EditorGUI.indentLevel--;
}
PropertyField("useGraphRaycasting");
if (FindProperty("useGraphRaycasting").boolValue) {
EditorGUILayout.HelpBox("Graph raycasting is only available in the pro version for the built-in graphs.", MessageType.Info);
}
if (!FindProperty("useGraphRaycasting").boolValue && !FindProperty("useRaycasting").boolValue) {
EditorGUILayout.HelpBox("You should use either raycasting, graph raycasting or both, otherwise this modifier will not do anything", MessageType.Warning);
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ec73ac2d3bd6342faace3242ff3e6f79
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}

View File

@ -0,0 +1,45 @@
using UnityEngine;
using UnityEditor;
namespace Pathfinding {
[CustomEditor(typeof(SimpleSmoothModifier))]
[CanEditMultipleObjects]
public class SmoothModifierEditor : EditorBase {
protected override void Inspector () {
var smoothType = FindProperty("smoothType");
PropertyField("smoothType");
if (!smoothType.hasMultipleDifferentValues) {
switch ((SimpleSmoothModifier.SmoothType)smoothType.enumValueIndex) {
case SimpleSmoothModifier.SmoothType.Simple:
if (PropertyField("uniformLength")) {
FloatField("maxSegmentLength", min: 0.005f);
} else {
IntSlider("subdivisions", 0, 6);
}
PropertyField("iterations");
ClampInt("iterations", 0);
PropertyField("strength");
break;
case SimpleSmoothModifier.SmoothType.OffsetSimple:
PropertyField("iterations");
ClampInt("iterations", 0);
FloatField("offset", min: 0f);
break;
case SimpleSmoothModifier.SmoothType.Bezier:
IntSlider("subdivisions", 0, 6);
PropertyField("bezierTangentLength");
break;
case SimpleSmoothModifier.SmoothType.CurvedNonuniform:
FloatField("maxSegmentLength", min: 0.005f);
PropertyField("factor");
break;
}
}
}
}
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1b6748a8c87024ddd9cc5f3c5e19ab60
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}