Exemplo n.º 1
0
    private void Refresh()
    {
        #region Button UI
        if (scanStateText != null)
        {
            scanStateText.text = BhapticsAndroidManager.IsScanning() ? "Scanning" : "Scan Stopped";
        }

        var head = BhapticsUtils.ToPositionType(HapticDeviceType.Tactal);
        talButtons.pair.interactable   = BhapticsAndroidManager.CanPairDevice(head);
        talButtons.ping.interactable   = BhapticsAndroidManager.GetConnectedDevices(head).Count > 0;
        talButtons.unpair.interactable = BhapticsAndroidManager.GetPairedDevices(head).Count > 0;

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

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

        var rightArm = BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, false);
        armsRightButtons.pair.interactable   = BhapticsAndroidManager.CanPairDevice(rightArm);
        armsRightButtons.ping.interactable   = BhapticsAndroidManager.GetConnectedDevices(rightArm).Count > 0;
        armsRightButtons.unpair.interactable = BhapticsAndroidManager.GetPairedDevices(rightArm).Count > 0;
        armsRightButtons.toggle.interactable = BhapticsAndroidManager.GetPairedDevices(rightArm).Count > 0;
        #endregion
    }
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            isClickedArea = GetPathPointOffset() != null;
        }

        if (!isClickedArea)
        {
            return;
        }

        if (!Input.GetMouseButton(0))
        {
            isClickedArea = false;
            return;
        }

        var haptic = BhapticsManager.GetHaptic();

        if (haptic == null)
        {
            return;
        }

        var currentPathPointOffset = GetPathPointOffset();

        if (currentPathPointOffset != null)
        {
            pathPointList[0].X = currentPathPointOffset.Value.x;
            pathPointList[0].Y = currentPathPointOffset.Value.y;

            haptic.Submit(key, BhapticsUtils.ToPositionType(clipPositionType), pathPointList, duration);
        }
    }
    public void ToggleTactosyArms(bool isLeft)
    {
        var connectedDevices = BhapticsAndroidManager.GetConnectedDevices(BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, isLeft));

        for (int i = 0; i < connectedDevices.Count; ++i)
        {
            BhapticsAndroidManager.TogglePosition(connectedDevices[i].Address);
        }
    }
    void Update()
    {
        var haptic = BhapticsManager.GetHaptic();

        if (haptic == null)
        {
            return;
        }

        haptic.Submit(key, BhapticsUtils.ToPositionType(clipPositionType), dotPointList, duration);
    }
Exemplo n.º 5
0
    void Update()
    {
        var haptic = BhapticsManager.GetHaptic();

        if (haptic == null)
        {
            return;
        }

        foreach (var vis in visualFeedback)
        {
            var feedback = haptic.GetCurrentFeedback(BhapticsUtils.ToPositionType(vis.devicePos));

            vis.UpdateFeedback(feedback);
        }
    }
    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
    }
 public void PingTactosyArms(bool isLeft)
 {
     PingPairedDevice(BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, isLeft));
 }
 public void PingTactSuit()
 {
     PingPairedDevice(BhapticsUtils.ToPositionType(HapticDeviceType.TactSuit));
 }
Exemplo n.º 9
0
 public void UnpairTactal()
 {
     UnpairHapticDevice(BhapticsUtils.ToPositionType(HapticDeviceType.Tactal));
 }
Exemplo n.º 10
0
 public void UnpairTactosyArms(bool isLeft)
 {
     UnpairHapticDevice(BhapticsUtils.ToPositionType(HapticDeviceType.Tactosy_arms, isLeft));
 }
Exemplo n.º 11
0
 public void PairTactSuit()
 {
     PairHapticDevice(BhapticsUtils.ToPositionType(HapticDeviceType.TactSuit));
 }