public bool SendHapticImpulse(uint channel, float amplitude, float duration = 1f)
        {
            bool flag = !this.IsValidId();
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = amplitude < 0f;
                if (flag2)
                {
                    throw new ArgumentException("Amplitude of SendHapticImpulse cannot be negative.");
                }
                bool flag3 = duration < 0f;
                if (flag3)
                {
                    throw new ArgumentException("Duration of SendHapticImpulse cannot be negative.");
                }
                result = InputDevices.SendHapticImpulse(this.m_DeviceId, channel, amplitude, duration);
            }
            return(result);
        }
Esempio n. 2
0
 // Haptics
 public bool SendHapticImpulse(uint channel, float amplitude, float duration = 1.0f)
 {
     if (amplitude < 0.0f)
     {
         throw new ArgumentException("Amplitude of SendHapticImpulse cannot be negative.");
     }
     if (duration < 0.0f)
     {
         throw new ArgumentException("Duration of SendHapticImpulse cannot be negative.");
     }
     return(InputDevices.SendHapticImpulse(m_DeviceId, channel, amplitude, duration));
 }