12345678910111213141516171819202122232425262728293031323334353637 |
-
- using UnityEditor;
- using UnityEngine;
- [CanEditMultipleObjects, CustomEditor(typeof(MegaShapeRectangle))]
- public class MegaShapeRectangleEditor : MegaShapeEditor
- {
- public override bool Params()
- {
- MegaShapeRectangle shape = (MegaShapeRectangle)target;
- bool rebuild = false;
- float v = EditorGUILayout.FloatField("Length", shape.length);
- if ( v != shape.length )
- {
- shape.length = v;
- rebuild = true;
- }
- v = EditorGUILayout.FloatField("Width", shape.width);
- if ( v != shape.width )
- {
- shape.width = v;
- rebuild = true;
- }
- v = EditorGUILayout.FloatField("Fillet", shape.fillet);
- if ( v != shape.fillet )
- {
- shape.fillet = v;
- rebuild = true;
- }
- return rebuild;
- }
- }
|