MagicaVirtualDeformerGizmoDrawer.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Magica Cloth.
  2. // Copyright (c) MagicaSoft, 2020-2022.
  3. // https://magicasoft.jp
  4. using UnityEditor;
  5. namespace MagicaCloth
  6. {
  7. /// <summary>
  8. /// MagicaVirtualDeformerのギズモ表示
  9. /// </summary>
  10. public class MagicaVirtualDeformerGizmoDrawer
  11. {
  12. [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected | GizmoType.Active)]
  13. static void DrawGizmo(MagicaVirtualDeformer scr, GizmoType gizmoType)
  14. {
  15. bool selected = (gizmoType & GizmoType.Selected) != 0 || (ClothMonitorMenu.Monitor != null && ClothMonitorMenu.Monitor.UI.AlwaysDeformerShow);
  16. if (PointSelector.EditEnable)
  17. return;
  18. if (ClothMonitorMenu.Monitor == null)
  19. return;
  20. if (ClothMonitorMenu.Monitor.UI.DrawDeformer == false)
  21. return;
  22. if (selected == false)
  23. return;
  24. // データ整合性チェック
  25. if (scr.VerifyData() != Define.Error.None)
  26. return;
  27. // デフォーマーギズモ
  28. DeformerGizmoDrawer.DrawDeformerGizmo(scr, scr);
  29. }
  30. }
  31. }