MagicaMeshClothGizmoDrawer.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Magica Cloth.
  2. // Copyright (c) MagicaSoft, 2020-2022.
  3. // https://magicasoft.jp
  4. using UnityEditor;
  5. namespace MagicaCloth
  6. {
  7. /// <summary>
  8. /// MagicaMeshClothのギズモ表示
  9. /// </summary>
  10. public class MagicaMeshClothGizmoDrawer
  11. {
  12. [DrawGizmo(GizmoType.Selected | GizmoType.NonSelected | GizmoType.Active)]
  13. static void DrawGizmo(MagicaMeshCloth scr, GizmoType gizmoType)
  14. {
  15. bool selected = (gizmoType & GizmoType.Selected) != 0 || (ClothMonitorMenu.Monitor != null && ClothMonitorMenu.Monitor.UI.AlwaysClothShow);
  16. if (ClothMonitorMenu.Monitor == null)
  17. return;
  18. if (selected == false)
  19. return;
  20. // 常に表示
  21. ClothGizmoDrawer.AlwaysDrawClothGizmo(scr, scr.Params);
  22. // デフォーマー状態表示
  23. //if (scr.Deformer != null && scr.Deformer.VerifyData())
  24. //{
  25. // if (PointSelector.EditEnable == false)
  26. // {
  27. // // デフォーマーギズモ
  28. // DeformerGizmoDrawer.DrawDeformerGizmo(scr.Deformer, scr, 0.01f);
  29. // }
  30. //}
  31. if (scr.VerifyData() == Define.Error.None)
  32. {
  33. // クロスギズモ
  34. if (PointSelector.EditEnable == false)
  35. {
  36. ClothGizmoDrawer.DrawClothGizmo(scr, scr.ClothData, scr.Params, scr.Setup, scr, scr);
  37. }
  38. }
  39. }
  40. }
  41. }