Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / data / DragBinder.cs
  1.  
  2. using System;
  3. using Godot;
  4.  
  5. /// <summary>
  6. /// 拖拽绑定数据对象, 通过 DragUiManager 创建
  7. /// </summary>
  8. public class DragBinder
  9. {
  10. public Control Control;
  11. public bool MouseEntered;
  12. public bool Dragging;
  13. public Vector2 PrevPosition;
  14. public Action<DragState, Vector2> Callback;
  15.  
  16. public void OnMouseEntered()
  17. {
  18. MouseEntered = true;
  19. }
  20. public void OnMouseExited()
  21. {
  22. MouseEntered = false;
  23. }
  24. public void UnBind()
  25. {
  26. DragUiManager.UnBindDrag(this);
  27. }
  28. }