InputExtra.cs 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using Godot;
  2. namespace TBL.GodotSharp.Input
  3. {
  4. /// <summary>
  5. /// 输入扩展
  6. /// </summary>
  7. public class InputExtra : Node
  8. {
  9. /// <summary>
  10. /// 控制器类型
  11. /// </summary>
  12. public enum ControllerType
  13. {
  14. /// <summary>
  15. /// 鼠标
  16. /// </summary>
  17. Mouse,
  18. /// <summary>
  19. /// 触摸
  20. /// </summary>
  21. Touch,
  22. /// <summary>
  23. /// 纯按钮(手柄/键盘)
  24. /// </summary>
  25. Button
  26. }
  27. /// <summary>
  28. /// 最后一次操作的控制器类型
  29. /// </summary>
  30. public ControllerType LastControllerType { get; private set; }
  31. public override void _EnterTree()
  32. {
  33. Name = nameof(InputExtra);
  34. }
  35. public override void _Input(InputEvent evt)
  36. {
  37. // TODO:
  38. }
  39. }
  40. }