AILerpEditor.cs 833 B

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