RaycastModifierEditor.cs 945 B

12345678910111213141516171819202122232425262728293031
  1. using UnityEditor;
  2. namespace Pathfinding {
  3. [CustomEditor(typeof(RaycastModifier))]
  4. [CanEditMultipleObjects]
  5. public class RaycastModifierEditor : EditorBase {
  6. protected override void Inspector () {
  7. PropertyField("quality");
  8. if (PropertyField("useRaycasting", "Use Physics Raycasting")) {
  9. EditorGUI.indentLevel++;
  10. PropertyField("use2DPhysics");
  11. if (PropertyField("thickRaycast")) {
  12. EditorGUI.indentLevel++;
  13. FloatField("thickRaycastRadius", min: 0f);
  14. EditorGUI.indentLevel--;
  15. }
  16. PropertyField("raycastOffset");
  17. PropertyField("mask", "Layer Mask");
  18. EditorGUI.indentLevel--;
  19. }
  20. PropertyField("useGraphRaycasting");
  21. if (!FindProperty("useGraphRaycasting").boolValue && !FindProperty("useRaycasting").boolValue) {
  22. EditorGUILayout.HelpBox("You should use either raycasting, graph raycasting or both, otherwise this modifier will not do anything", MessageType.Warning);
  23. }
  24. }
  25. }
  26. }