暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

InitiateUserAccountPairingCommand.cs 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Runtime.InteropServices;
  2. using UnityEngine.InputSystem.Utilities;
  3. namespace UnityEngine.InputSystem.LowLevel
  4. {
  5. /// <summary>
  6. /// Device command to instruct the underlying platform to pair a user account to the targeted device.
  7. /// </summary>
  8. /// <remarks>
  9. ///
  10. /// If successful, the platform should then send an <see cref="DeviceConfigurationEvent"/>
  11. /// to signal that the device configuration has been changed. In response, a <see cref="QueryUserIdCommand"/>
  12. /// may be sent to fetch the paired user ID from the device.
  13. /// </remarks>
  14. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  15. public struct InitiateUserAccountPairingCommand : IInputDeviceCommandInfo
  16. {
  17. public static FourCC Type { get { return new FourCC('P', 'A', 'I', 'R'); } }
  18. internal const int kSize = InputDeviceCommand.kBaseCommandSize;
  19. [FieldOffset(0)]
  20. public InputDeviceCommand baseCommand;
  21. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue", Justification = "Enum values mandated by native code")]
  22. public enum Result
  23. {
  24. /// <summary>
  25. /// User pairing UI has been successfully opened.
  26. /// </summary>
  27. SuccessfullyInitiated = 1,
  28. /// <summary>
  29. /// System does not support application-invoked user pairing.
  30. /// </summary>
  31. ErrorNotSupported = (int)InputDeviceCommand.GenericFailure,
  32. /// <summary>
  33. /// There already is a pairing operation in progress and the system does not support
  34. /// pairing multiple devices at the same time.
  35. /// </summary>
  36. ErrorAlreadyInProgress = -2,
  37. }
  38. public FourCC typeStatic
  39. {
  40. get { return Type; }
  41. }
  42. public static InitiateUserAccountPairingCommand Create()
  43. {
  44. return new InitiateUserAccountPairingCommand
  45. {
  46. baseCommand = new InputDeviceCommand(Type, kSize),
  47. };
  48. }
  49. }
  50. }