MegaShapeLineEditor.cs 857 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 
  2. using UnityEditor;
  3. using UnityEngine;
  4. [CanEditMultipleObjects, CustomEditor(typeof(MegaShapeLine))]
  5. public class MegaShapeLineEditor : MegaShapeEditor
  6. {
  7. public override bool Params()
  8. {
  9. MegaShapeLine shape = (MegaShapeLine)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. int p = EditorGUILayout.IntField("Points", shape.points);
  18. if ( p != shape.points )
  19. {
  20. shape.points = p;
  21. rebuild = true;
  22. }
  23. v = EditorGUILayout.FloatField("Dir", shape.dir);
  24. if ( v != shape.dir )
  25. {
  26. shape.dir = v;
  27. rebuild = true;
  28. }
  29. Transform tm = (Transform)EditorGUILayout.ObjectField("End", shape.end, typeof(Transform), true);
  30. if ( tm != shape.end )
  31. {
  32. shape.end = tm;
  33. rebuild = true;
  34. }
  35. return rebuild;
  36. }
  37. }