Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / data / DragBinder.cs
@小李xl 小李xl on 19 Dec 2023 584 bytes 整理目录结构, 抽出InputAction
  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. public StringName[] InputAction;
  16.  
  17. public void OnMouseEntered()
  18. {
  19. MouseEntered = true;
  20. }
  21. public void OnMouseExited()
  22. {
  23. MouseEntered = false;
  24. }
  25. public void UnBind()
  26. {
  27. UiDragManager.UnBindDrag(this);
  28. }
  29. }