private GestureType ConvertedGesture(MLInputControllerTouchpadGestureType gesture) { switch (gesture) { case MLInputControllerTouchpadGestureType.ForceDwell: break; case MLInputControllerTouchpadGestureType.ForceTapDown: break; case MLInputControllerTouchpadGestureType.ForceTapUp: break; case MLInputControllerTouchpadGestureType.LongHold: break; case MLInputControllerTouchpadGestureType.Pinch: break; case MLInputControllerTouchpadGestureType.RadialScroll: return GestureType.RadialScroll; case MLInputControllerTouchpadGestureType.Scroll: break; case MLInputControllerTouchpadGestureType.SecondForceDown: break; case MLInputControllerTouchpadGestureType.Swipe: break; case MLInputControllerTouchpadGestureType.Tap: break; } return GestureType.None; }
public void CheckHasFocusBrain() { Debug.Log("Brain Split Animation Initiated"); MLInputController mlInputController = MLInput.GetController(0); MLInputControllerTouchpadGesture gesture = mlInputController.TouchpadGesture; MLInputControllerTouchpadGestureType gestureType = gesture.Type; if (gestureType == MLInputControllerTouchpadGestureType.Swipe) { brainAnimator.SetBool("SplitBrain", true); brainAnimatorUnlit.SetBool("SplitBrain", true); swipeAnim.SetActive(false); UIInstructionText.text = ""; AudioManager._instance.PlayAudio(0); gameSequenceInt++; } }
private void HandleTouch() { MLInputControllerTouchpadGestureType gesture = _controllerConnectionHandler.ConnectedController.TouchpadGesture.Type; if (gesture != MLInputControllerTouchpadGestureType.Swipe) { return; } MLInputControllerTouchpadGestureDirection direction = _controllerConnectionHandler.ConnectedController.TouchpadGesture.Direction; if (_mode == touchMode.Beam) { if (direction == MLInputControllerTouchpadGestureDirection.Up) { _beamLen += _changeRate; } else if (direction == MLInputControllerTouchpadGestureDirection.Down) { _beamLen -= _changeRate; if (_beamLen < 0) { _beamLen = 0; } } } else if (_mode == touchMode.Rotation) { if (direction == MLInputControllerTouchpadGestureDirection.Right) { _modelRotation -= _changeRateRotation; } else if (direction == MLInputControllerTouchpadGestureDirection.Left) { _modelRotation += _changeRateRotation; } if (_modelRotation > 360) { _modelRotation -= 360; } else if (_modelRotation < -360) { _modelRotation += 360; } _placementObject.transform.rotation = Quaternion.Euler(0, _modelRotation, 0); } else if (_mode == touchMode.Scale) { if (direction == MLInputControllerTouchpadGestureDirection.Up) { _modelScale += _changeRate; } else if (direction == MLInputControllerTouchpadGestureDirection.Down) { _modelScale -= _changeRate; if (_modelScale < 0) { _modelScale = 0; } } _placementObject.transform.localScale = new Vector3(_modelScale, _modelScale, _modelScale); } }