Ejemplo n.º 1
0
        public void SetMotorSpeeds(float leftMotor, float rightMotor, float leftTriggerMotor, float rightTriggerMotor)
        {
            var command = XboxOneGamepadRumbleCommand.Create();

            command.SetMotorSpeeds(leftMotor, rightMotor, leftTriggerMotor, rightTriggerMotor);

            ExecuteCommand(ref command);

            m_LeftMotor         = leftMotor;
            m_RightMotor        = rightMotor;
            m_LeftTriggerMotor  = leftTriggerMotor;
            m_RightTriggerMotor = rightTriggerMotor;
        }
Ejemplo n.º 2
0
        public override void PauseHaptics()
        {
            if (!m_LeftMotor.HasValue && !m_RightMotor.HasValue && !m_LeftTriggerMotor.HasValue && !m_RightTriggerMotor.HasValue)
            {
                return;
            }

            var command = XboxOneGamepadRumbleCommand.Create();

            command.SetMotorSpeeds(0f, 0f, 0f, 0f);

            ExecuteCommand(ref command);
        }
Ejemplo n.º 3
0
        public void SetMotorSpeeds(float lowFrequency, float highFrequency, float leftTrigger, float rightTrigger)
        {
            var command = XboxOneGamepadRumbleCommand.Create();

            command.SetMotorSpeeds(lowFrequency, highFrequency, leftTrigger, rightTrigger);

            ExecuteCommand(ref command);

            m_LeftMotor         = lowFrequency;
            m_RightMotor        = highFrequency;
            m_LeftTriggerMotor  = leftTrigger;
            m_RightTriggerMotor = rightTrigger;
        }
Ejemplo n.º 4
0
        public override void ResumeHaptics()
        {
            if (!m_LeftMotor.HasValue && !m_RightMotor.HasValue && !m_LeftTriggerMotor.HasValue && !m_RightTriggerMotor.HasValue)
            {
                return;
            }

            var command = XboxOneGamepadRumbleCommand.Create();

            if (m_LeftMotor.HasValue || m_RightMotor.HasValue || m_LeftTriggerMotor.HasValue || m_RightTriggerMotor.HasValue)
            {
                command.SetMotorSpeeds(m_LeftMotor.Value, m_RightMotor.Value, m_LeftTriggerMotor.Value, m_RightTriggerMotor.Value);
            }

            ExecuteCommand(ref command);
        }