Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

DualMotorRumbleCommand.cs 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Runtime.InteropServices;
  2. using UnityEngine.InputSystem.Utilities;
  3. namespace UnityEngine.InputSystem.LowLevel
  4. {
  5. [StructLayout(LayoutKind.Explicit, Size = kSize)]
  6. internal struct DualMotorRumbleCommand : IInputDeviceCommandInfo
  7. {
  8. public static FourCC Type { get { return new FourCC('R', 'M', 'B', 'L'); } }
  9. internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(float) * 2;
  10. [FieldOffset(0)]
  11. public InputDeviceCommand baseCommand;
  12. [FieldOffset(InputDeviceCommand.kBaseCommandSize)]
  13. public float lowFrequencyMotorSpeed;
  14. [FieldOffset(InputDeviceCommand.kBaseCommandSize + 4)]
  15. public float highFrequencyMotorSpeed;
  16. public FourCC typeStatic
  17. {
  18. get { return Type; }
  19. }
  20. public static DualMotorRumbleCommand Create(float lowFrequency, float highFrequency)
  21. {
  22. return new DualMotorRumbleCommand
  23. {
  24. baseCommand = new InputDeviceCommand(Type, kSize),
  25. lowFrequencyMotorSpeed = lowFrequency,
  26. highFrequencyMotorSpeed = highFrequency
  27. };
  28. }
  29. }
  30. }