Beispiel #1
0
    void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs state)
    {
        if (state.state.source.handedness == handedness)
        {
            switch (state.pressType)
            {
            case InteractionSourcePressType.Select:
                triggerpressed = false;
                triggerup      = true;
                break;

            case InteractionSourcePressType.Menu:
                menupressed = false;
                menuup      = true;
                break;

            case InteractionSourcePressType.Grasp:
                grasppressed = false;
                graspup      = true;
                break;

            case InteractionSourcePressType.Touchpad:
                touchpadpressed = false;
                touchpadup      = true;
                break;

            case InteractionSourcePressType.Thumbstick:
                thumbstickpressed = false;
                thumbstickup      = true;
                break;
            }
        }
    }
Beispiel #2
0
 /// <summary>
 /// Releases active
 /// </summary>
 /// <param name="obj"></param>
 private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.state.source.handedness == Handedness && obj.pressType == activePressType)
     {
         pointer.Active = false;
     }
 }
        /// <summary>
        /// 指が元の位置に戻った
        /// </summary>
        /// <param name="hand">hand</param>
        private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs hand)
        {
            DebugLog.Instance.Log += "Rleased\n";

            // FocusedGameObject をリセットする
            this.ResetFocusedGameObject();
        }
Beispiel #4
0
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.state.source.kind == InteractionSourceKind.Hand)
     {
         // Stop displaying the guidance indicator when the user releases their finger from the pressed state.
     }
 }
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
 {
     if (IsTarget(args.state))
     {
         UpdatePressed(args.pressType, args.state);
     }
 }
 /// <summary>
 /// SDK Interaction Source Released Event handler. Used only for voice.
 /// </summary>
 /// <param name="args">SDK source released event arguments</param>
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
 {
     if (args.state.source.kind == InteractionSourceKind.Voice)
     {
         GetOrAddController(args.state.source)?.UpdateController(args.state);
     }
 }
Beispiel #7
0
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
 {
     if ((args.pressType == InteractionSourcePressType.Grasp || args.pressType == InteractionSourcePressType.Select) &&
         CanThrow)
     {
         uint id = args.state.source.id;
         if (devices.ContainsKey(id))
         {
             var go        = devices[id];
             var rigidbody = go.GetComponent <Rigidbody>();
             if (rigidbody == null)
             {
                 rigidbody = go.GetComponentInChildren <Rigidbody>();
             }
             if (rigidbody.TryThrow(args.state.sourcePose))
             {
                 DetatchDevice(id);
             }
             else
             {
                 throw new System.Exception("Throw failed!!!");
             }
         }
     }
 }
Beispiel #8
0
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (InteractionSourceReleased != null)
     {
         InteractionSourceReleased(obj);
     }
 }
Beispiel #9
0
 /// <summary>
 /// ボタンが離されたときの処理
 /// </summary>
 /// <param name="obj">入力情報</param>
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.state.source.id == id)
     {
         Debug.Log("ボタンが離されました");
         buttonPressed = false;
     }
 }
 private void InputEndCallback(InteractionSourceReleasedEventArgs e)
 {
     if (EventIsRelevant(e))
     {
         InputEnd(e);
         Active = false;
     }
 }
Beispiel #11
0
 private void InteractionManagerOnSourceReleased(InteractionSourceReleasedEventArgs args)
 {
     print("Released");
     if (args.state.source.id == sourceId)
     {
         sourceId = 0;
     }
 }
Beispiel #12
0
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
 {
     if (isRightController(args.state))
     {
         UpdatePressed(args.pressType, args.state);
         _material.SetColor("_Color", Color.white);
     }
 }
 void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.pressType == InteractionSourcePressType.Thumbstick)
     {
         inputAction    = MultiARInterop.InputAction.Release;
         inputTimestamp = lastFrameTimestamp;
     }
 }
Beispiel #14
0
 private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.pressType == pressType && obj.state.source.handedness == handedness)
     {
         TrySetThrowableObject(GrabbedObjects.Count > 0 ? GrabbedObjects[0] : null, obj.state.sourcePose);
         GrabEnd();
     }
 }
 private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.state.source.handedness == InteractionSourceHandedness.Right && obj.pressType == InteractionSourcePressType.Select)
     {
         Draw  = false;
         width = 0f;
     }
 }
Beispiel #16
0
 private void UseInputEnd(InteractionSourceReleasedEventArgs obj)
 {
     if (/*obj.pressType == pressType && */ obj.state.source.handedness == handedness)
     {
         state = UseStateEnum.Inactive;
         UseEnd();
     }
 }
Beispiel #17
0
    private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
    {
        if (args.state.source.kind != InteractionSourceKind.Hand)
        {
            return;
        }

        InteractionEnded();
    }
Beispiel #18
0
 private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if (obj.pressType == pressType && obj.state.source.handedness == handedness)
     {
         TrySetThrowableObject(GrabbedObjects.Count > 0 ? GrabbedObjects[0] : null, obj.state.sourcePose);
         GrabEnd();
         _myFist.SetActive(false);
         _handAnimator.SetTrigger("HandRelease");
     }
 }
        protected virtual void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
        {
            InteractionSourceState state  = args.state;
            InteractionSource      source = state.source;

            if (source.kind == InteractionSourceKind.Controller && source.handedness == handedness)
            {
                UpdateButtonState(args.pressType, state);
            }
        }
        //InteractionSourceReleased
        //private void WSAFingerReleased(InteractionSourceState state)
        //{
        //    CurrentHandState inputState = trackedHands.Find(CurrentInputState => CurrentInputState.HandId == state.source.id);
        //    if (inputState != null)
        //    {
        //        UpdateFromWSASource(inputState, state);
        //        OnFingerReleased(inputState);
        //    }
        //}

        private void WSAFingerReleased(InteractionSourceReleasedEventArgs state)
        {
            CurrentHandState inputState = trackedHands.Find(CurrentInputState => CurrentInputState.HandId == state.state.source.id);

            if (inputState != null)
            {
                UpdateFromWSASource(inputState, state.state);
                OnFingerReleased(inputState);
            }
        }
Beispiel #21
0
        protected override void InputEnd(InteractionSourceReleasedEventArgs e)
        {
            Debug.Log("Screwdriver is DONE being USED.");



            //if (this.AttachedScrew != null)
            //{
            //    ReleaseScrew();
            //}
        }
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     // Air-Tapのリリース時のコールバック処理
     if (state == RingCommandState.ACTIVE)
     {
         // リングコマンドを消す
         // 選択しているアイテムの生成とタイミングを少し開けたかったので、
         // Pressedで生成、Releasedでコマンド消滅としてみた。
         StartFadeOut();
     }
 }
Beispiel #23
0
        private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
        {
            var pressType = (InteractionSourcePressInfo)args.pressType;

            // HACK: If we're not dealing with a spatial controller we may not get Select called properly
            if (args.state.source.kind != InteractionSourceKind.Controller || !args.state.source.supportsPointing)
            {
                pressType = InteractionSourcePressInfo.Select;
            }

            InputManager.Instance.RaiseSourceUp(this, args.state.source.id, pressType);
        }
Beispiel #24
0
    private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
    {
        // On HoloLens 2 a grasp event is also raised that we don't want to pass along as a click.
        if (obj.pressType == InteractionSourcePressType.Grasp)
        {
            return;
        }

        if (targeted != null)
        {
            targeted.onClick.Invoke();
        }
    }
Beispiel #25
0
    private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
    {
        // Release
        var handedness = obj.state.source.handedness;

        if (handedness == InteractionSourceHandedness.Right)
        {
            rightChildHand.localScale = Vector3.one;
        }
        else if (handedness == InteractionSourceHandedness.Left)
        {
            leftChildHand.localScale = Vector3.one;
        }
    }
    private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs hand)
    {
        FingerDown = false;

        if (InteractibleManager.Instance.FocusedGameObject != null)
        {
            FocusedGameObject = InteractibleManager.Instance.FocusedGameObject;
            Interactible interactor = FocusedGameObject.GetComponent <Interactible>();
            if (interactor != null)
            {
                interactor.OffSelect();
            }
        }
        ResetFocusedGameObject();
    }
Beispiel #27
0
        private void OtherThread_InteractionSourceReleased(InteractionSourceReleasedEventArgs args)
        {
            Vector3 handPosition;

            if (args.state.source.kind == InteractionSourceKind.Hand && args.state.sourcePose.TryGetPosition(out handPosition))
            {
                QueuedAction newAction = new QueuedAction {
                    actionType = QueuedActionType.TapReleased, id = args.state.source.id, position = handPosition, timestamp = Time.time
                };

                lock (actionQueue)
                {
                    actionQueue.Enqueue(newAction);
                }
            }
        }
Beispiel #28
0
 private void InteractionManager_InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
 {
     if ((obj.state.source.handedness == InteractionSourceHandedness.Right && isRightController) || (obj.state.source.handedness == InteractionSourceHandedness.Left && !isRightController))
     {
         if (pressTrigger)
         {
             gameObject.GetComponent <Animator>().SetBool("TriggerPress", false);
             pressTrigger = false;
         }
         else if (pressGrip)
         {
             gameObject.GetComponent <Animator>().SetBool("GripPress", false);
             pressGrip = false;
         }
     }
 }
        private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
        {
            if (obj.state.source.handedness == Handedness)
            {
                switch (obj.pressType)
                {
                case InteractionSourcePressType.Select:
                    if (state == StateEnum.Spawning)
                    {
                        // We've released select - return to idle state
                        state = StateEnum.Idle;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Beispiel #30
0
    private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
    {
        if ((obj.state.source.handedness == InteractionSourceHandedness.Left && right) ||
            (obj.state.source.handedness == InteractionSourceHandedness.Right && !right))
        {
            return;
        }
        if (obj.pressType == InteractionSourcePressType.Select)
        {
            handAnimator.SetBool("Grabbed", false);
            if (grabbedObject != null)
            {
                grabbedObject.Untarget();

                grabbedObject.Drop();
                grabbedObject = null;
            }
        }
    }