CustomGizmo.cs 636 B

123456789101112131415161718192021222324
  1. using System.Reflection;
  2. namespace CM3D2.MultipleMaids.Plugin
  3. {
  4. public class CustomGizmo : GizmoRender
  5. {
  6. private static FieldInfo is_drag_ = MultipleMaids.GetFieldInfo<GizmoRender>("is_drag_");
  7. public static bool IsDrag
  8. {
  9. get => (bool)is_drag_.GetValue(null);
  10. set => is_drag_.SetValue(null, value);
  11. }
  12. public new bool Visible
  13. {
  14. get => base.Visible;
  15. set
  16. {
  17. if (value == base.Visible) return;
  18. if (IsDrag) IsDrag = false;
  19. base.Visible = value;
  20. }
  21. }
  22. }
  23. }