示例#1
0
 void SetupVibrationDevices()
 {
     if (HasNPadStyle)
     {
         VibrationDeviceCount = Vibration.GetDeviceHandles(VibrationDeviceHandles, 2, NPadId, NPadStyle);
         for (var i = 0; i < VibrationDeviceCount; i++)
         {
             Vibration.InitializeDevice(VibrationDeviceHandles[i]);
             Vibration.GetDeviceInfo(ref VibrationDeviceInfos[i], VibrationDeviceHandles[i]);
         }
     }
 }
    private void GetVibrationDevice(nn.hid.NpadId id, nn.hid.NpadStyle style)
    {
        vibrationValue.Clear();
        for (int i = 0; i < vibrationDeviceCount; i++)
        {
            Vibration.SendValue(vibrationDeviceHandles[i], vibrationValue);
        }

        vibrationDeviceCount = Vibration.GetDeviceHandles(
            vibrationDeviceHandles, vibrationDeviceCountMax, id, style);

        for (int i = 0; i < vibrationDeviceCount; i++)
        {
            Vibration.InitializeDevice(vibrationDeviceHandles[i]);
            Vibration.GetDeviceInfo(ref vibrationDeviceInfos[i], vibrationDeviceHandles[i]);
        }
    }