MegaShapeEllipseEditor.cs 569 B

123456789101112131415161718192021222324252627282930
  1. 
  2. using UnityEditor;
  3. using UnityEngine;
  4. [CanEditMultipleObjects, CustomEditor(typeof(MegaShapeEllipse))]
  5. public class MegaShapeEllipseEditor : MegaShapeEditor
  6. {
  7. public override bool Params()
  8. {
  9. MegaShapeEllipse shape = (MegaShapeEllipse)target;
  10. bool rebuild = false;
  11. float v = EditorGUILayout.FloatField("Length", shape.length);
  12. if ( v != shape.length )
  13. {
  14. shape.length = v;
  15. rebuild = true;
  16. }
  17. v = EditorGUILayout.FloatField("Width", shape.width);
  18. if ( v != shape.width )
  19. {
  20. shape.width = v;
  21. rebuild = true;
  22. }
  23. return rebuild;
  24. }
  25. }