void CreateLongPressGesture() { LongPressGestureRecognizer tap = new LongPressGestureRecognizer(); tap.MinimumDurationSeconds = 0f; tap.StateUpdated += Tap_Updated; FingersScript.Instance.AddGesture(tap); tap.AllowSimultaneousExecutionWithAllGestures(); swipe.AllowSimultaneousExecutionWithAllGestures(); }
void Start() { swipe = new SwipeGestureRecognizer(); swipe.StateUpdated += Swipe_Updated; swipe.DirectionThreshold = 0; swipe.MinimumSpeedUnits = 1f; swipe.MinimumDistanceUnits = 1f; swipe.MinimumNumberOfTouchesToTrack = swipe.MaximumNumberOfTouchesToTrack = SwipeTouchCount; swipe.ThresholdSeconds = SwipeThresholdSeconds; FingersScript.Instance.AddGesture(swipe); LongPressGestureRecognizer tap = new LongPressGestureRecognizer(); tap.MinimumDurationSeconds = 0f; tap.StateUpdated += Tap_Updated; FingersScript.Instance.AddGesture(tap); tap.AllowSimultaneousExecutionWithAllGestures(); swipe.AllowSimultaneousExecutionWithAllGestures(); _cam = Camera.main; }