A game about forced loneliness, made by TACStudios
at master 1.3 kB view raw
1using System; 2using System.Runtime.InteropServices; 3using UnityEngine.InputSystem.Utilities; 4 5namespace UnityEngine.InputSystem.LowLevel 6{ 7 /// <summary> 8 /// Sets the position for IME dialogs. This is in pixels, from the upper left corner going down and to the right. 9 /// </summary> 10 [StructLayout(LayoutKind.Explicit, Size = kSize)] 11 public unsafe struct SetIMECursorPositionCommand : IInputDeviceCommandInfo 12 { 13 public static FourCC Type { get { return new FourCC('I', 'M', 'E', 'P'); } } 14 15 internal const int kSize = InputDeviceCommand.kBaseCommandSize + (sizeof(float) * 2); 16 17 [FieldOffset(0)] 18 public InputDeviceCommand baseCommand; 19 20 public Vector2 position 21 { 22 get { return m_Position; } 23 } 24 25 [FieldOffset(InputDeviceCommand.kBaseCommandSize)] 26 Vector2 m_Position; 27 28 public FourCC typeStatic 29 { 30 get { return Type; } 31 } 32 33 public static SetIMECursorPositionCommand Create(Vector2 cursorPosition) 34 { 35 return new SetIMECursorPositionCommand 36 { 37 baseCommand = new InputDeviceCommand(Type, kSize), 38 m_Position = cursorPosition 39 }; 40 } 41 } 42}