Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / common / UiEventBinder.cs
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// Ui事件绑定数据对象
  6. /// </summary>
  7. public class UiEventBinder
  8. {
  9. private Control Control;
  10. private Control.GuiInputEventHandler Callback;
  11.  
  12. public UiEventBinder(Control control, Control.GuiInputEventHandler callback)
  13. {
  14. Control = control;
  15. Callback = callback;
  16. }
  17.  
  18. /// <summary>
  19. /// 解除绑定事件
  20. /// </summary>
  21. public void UnBind()
  22. {
  23. Control.GuiInput -= Callback;
  24. }
  25. }