Adding A* Algorythm and carpet roads
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
AR/Assets/AstarPathfindingProject/Editor/ModifierEditors/RaycastModifierEditor.cs.meta
generated
Normal file
7
AR/Assets/AstarPathfindingProject/Editor/ModifierEditors/RaycastModifierEditor.cs.meta
generated
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ec73ac2d3bd6342faace3242ff3e6f79
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
7
AR/Assets/AstarPathfindingProject/Editor/ModifierEditors/SmoothModifierEditor.cs.meta
generated
Normal file
7
AR/Assets/AstarPathfindingProject/Editor/ModifierEditors/SmoothModifierEditor.cs.meta
generated
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b6748a8c87024ddd9cc5f3c5e19ab60
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
Reference in New Issue
Block a user