Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

QueryUserIdCommand.cs 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using UnityEngine.InputSystem.Utilities;
  4. ////TODO: remove this one; superseded by QueryPairedUserAccountCommand
  5. namespace UnityEngine.InputSystem.LowLevel
  6. {
  7. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  8. internal unsafe struct QueryUserIdCommand : IInputDeviceCommandInfo
  9. {
  10. public static FourCC Type { get { return new FourCC('U', 'S', 'E', 'R'); } }
  11. public const int kMaxIdLength = 256;
  12. internal const int kSize = InputDeviceCommand.kBaseCommandSize + kMaxIdLength * 2;
  13. [FieldOffset(0)]
  14. public InputDeviceCommand baseCommand;
  15. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  16. public fixed byte idBuffer[kMaxIdLength * 2];
  17. public string ReadId()
  18. {
  19. fixed(QueryUserIdCommand * thisPtr = &this)
  20. {
  21. return StringHelpers.ReadStringFromBuffer(new IntPtr(thisPtr->idBuffer), kMaxIdLength);
  22. }
  23. }
  24. public FourCC typeStatic
  25. {
  26. get { return Type; }
  27. }
  28. public static QueryUserIdCommand Create()
  29. {
  30. return new QueryUserIdCommand
  31. {
  32. baseCommand = new InputDeviceCommand(Type, kSize),
  33. };
  34. }
  35. }
  36. }