MegaShapeRectangleEditor.cs 711 B

12345678910111213141516171819202122232425262728293031323334353637
  1. 
  2. using UnityEditor;
  3. using UnityEngine;
  4. [CanEditMultipleObjects, CustomEditor(typeof(MegaShapeRectangle))]
  5. public class MegaShapeRectangleEditor : MegaShapeEditor
  6. {
  7. public override bool Params()
  8. {
  9. MegaShapeRectangle shape = (MegaShapeRectangle)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. v = EditorGUILayout.FloatField("Fillet", shape.fillet);
  24. if ( v != shape.fillet )
  25. {
  26. shape.fillet = v;
  27. rebuild = true;
  28. }
  29. return rebuild;
  30. }
  31. }