public BufferedRumble(InputDevice device)
        {
            this.device = device;

            var command = GetHapticCapabilitiesCommand.Create();

            device.ExecuteCommand(ref command);
            capabilities = command.capabilities;
        }
示例#2
0
        public BufferedRumble(InputDevice device)
        {
            if (device == null)
            {
                throw new System.ArgumentNullException(nameof(device));
            }

            this.device = device;

            var command = GetHapticCapabilitiesCommand.Create();

            device.ExecuteCommand(ref command);
            capabilities = command.capabilities;
        }
        public void SetMotorSpeeds(InputDevice device, float lowFrequency, float highFrequency)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }

            lowFrequencyMotorSpeed  = Mathf.Clamp(lowFrequency, 0.0f, 1.0f);
            highFrequencyMotorSpeed = Mathf.Clamp(highFrequency, 0.0f, 1.0f);

            var command = DualMotorRumbleCommand.Create(lowFrequencyMotorSpeed, highFrequencyMotorSpeed);

            device.ExecuteCommand(ref command);
        }
        public void PauseHaptics(InputDevice device)
        {
            if (device == null)
            {
                throw new ArgumentNullException("device");
            }

            if (!isRumbling)
            {
                return;
            }

            var command = DualMotorRumbleCommand.Create(0f, 0f);

            device.ExecuteCommand(ref command);
        }