No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

QueryEditorWindowCoordinatesCommand.cs 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. #if UNITY_EDITOR
  2. using System.Runtime.InteropServices;
  3. using UnityEngine.InputSystem.Utilities;
  4. ////REVIEW: This mechanism sucks. We should have this conversion without the device having to support it through an IOCTL. A Pointer
  5. //// should just inherently have this conversion mechanism on its controls that operate in screen space.
  6. namespace UnityEngine.InputSystem.LowLevel
  7. {
  8. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  9. internal struct QueryEditorWindowCoordinatesCommand : IInputDeviceCommandInfo
  10. {
  11. public static FourCC Type => new FourCC('E', 'W', 'P', 'S');
  12. internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(float) * 2;
  13. [FieldOffset(0)]
  14. public InputDeviceCommand baseCommand;
  15. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  16. public Vector2 inOutCoordinates;
  17. public FourCC typeStatic => Type;
  18. public static QueryEditorWindowCoordinatesCommand Create(Vector2 playerWindowCoordinates)
  19. {
  20. return new QueryEditorWindowCoordinatesCommand
  21. {
  22. baseCommand = new InputDeviceCommand(Type, kSize),
  23. inOutCoordinates = playerWindowCoordinates
  24. };
  25. }
  26. }
  27. }
  28. #endif // UNITY_EDITOR