示例#1
0
 private void ToggleEnable()
 {
     foreach (var hapticDevice in BhapticsAndroidManager.GetDevices())
     {
         BhapticsAndroidManager.ToggleEnableDevice(hapticDevice);
     }
 }
    private void Refresh()
    {
        #region UI
        var head = BhapticsUtils.ToPositionType(HapticDeviceType.Tactal);
        talButtons.ping.interactable = BhapticsAndroidManager.GetConnectedDevices(head).Count > 0;

        var suit = BhapticsUtils.ToPositionType(HapticDeviceType.TactSuit);
        suitButtons.ping.interactable = BhapticsAndroidManager.GetConnectedDevices(suit).Count > 0;

        var leftArm = BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, true);
        armsLeftButtons.ping.interactable   = BhapticsAndroidManager.GetConnectedDevices(leftArm).Count > 0;
        armsLeftButtons.toggle.interactable = BhapticsAndroidManager.GetPairedDevices(leftArm).Count > 0;

        var rightArm = BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, false);
        armsRightButtons.ping.interactable   = BhapticsAndroidManager.GetConnectedDevices(rightArm).Count > 0;
        armsRightButtons.toggle.interactable = BhapticsAndroidManager.GetPairedDevices(rightArm).Count > 0;

        if (pairedDevicesCount != null)
        {
            pairedDevicesCount.text = BhapticsAndroidManager.GetDevices().Count.ToString();
        }
        #endregion
    }