You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

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);
}
}
}
}