AILerpEditor.cs 922 B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace Pathfinding {
  4. [CustomEditor(typeof(AILerp), true)]
  5. [CanEditMultipleObjects]
  6. public class AILerpEditor : EditorBase {
  7. protected override void Inspector () {
  8. Section("Pathfinding");
  9. if (PropertyField("canSearch")) {
  10. EditorGUI.indentLevel++;
  11. FloatField("repathRate", min: 0f);
  12. EditorGUI.indentLevel--;
  13. }
  14. Section("Movement");
  15. FloatField("speed", min: 0f);
  16. PropertyField("canMove");
  17. if (PropertyField("enableRotation")) {
  18. EditorGUI.indentLevel++;
  19. Popup("orientation", new [] { new GUIContent("ZAxisForward (for 3D games)"), new GUIContent("YAxisForward (for 2D games)") });
  20. FloatField("rotationSpeed", min: 0f);
  21. EditorGUI.indentLevel--;
  22. }
  23. if (PropertyField("interpolatePathSwitches")) {
  24. EditorGUI.indentLevel++;
  25. FloatField("switchPathInterpolationSpeed", min: 0f);
  26. EditorGUI.indentLevel--;
  27. }
  28. }
  29. }
  30. }