コード例 #1
0
        public virtual void EndInteraction(NVRInteractable item)
        {
            if (item != null && CurrentlyHoveringOver.ContainsKey(item) == true)
            {
                CurrentlyHoveringOver.Remove(item);
            }

            if (CurrentlyInteracting != null)
            {
                CurrentlyInteracting.EndInteraction();

                if (OnEndInteraction != null)
                {
                    OnEndInteraction.Invoke(CurrentlyInteracting);
                }

                CurrentlyInteracting = null;
            }

            if (CurrentInteractionStyle == InterationStyle.Toggle)
            {
                if (CurrentHandState != HandState.Idle)
                {
                    CurrentHandState = HandState.Idle;
                }
            }
        }
コード例 #2
0
        public virtual void EndInteraction(NVRInteractable item)
        {
            if (item != null && CurrentlyHoveringOver.ContainsKey(item) == true)
            {
                CurrentlyHoveringOver.Remove(item);
            }

            if (CurrentlyInteracting != null)
            {
                // Implemented hand controller should subscribe to this event and implement appropriate functionality
                OnEndInteractionCustomHands.Invoke(CurrentlyInteracting);

                CurrentlyInteracting.EndInteraction(this);

                if (OnEndInteraction != null)
                {
                    OnEndInteraction.Invoke(CurrentlyInteracting);
                }

                if (PhysicalController)
                {
                    PhysicalController.Off();       // disable Phyiscal Hand component after interaction
                }
                CurrentlyInteracting = null;
            }

            if (CurrentInteractionStyle == InterationStyle.Toggle)
            {
                if (CurrentHandState != HandState.Idle)
                {
                    CurrentHandState = HandState.Idle;
                }
            }
        }
コード例 #3
0
ファイル: NVRHand.cs プロジェクト: starslights/NewtonVR
        public void EndInteraction(NVRInteractable item)
        {
            if (item != null && CurrentlyHoveringOver.ContainsKey(item) == true)
            {
                CurrentlyHoveringOver.Remove(item);
            }

            if (CurrentlyInteracting != null)
            {
                CurrentlyInteracting.EndInteraction();
                CurrentlyInteracting = null;
            }
        }
コード例 #4
0
        public virtual void EndInteraction(NVRInteractable item)
        {
            if (item != null && CurrentlyHoveringOver.ContainsKey(item) == true)
            {
                CurrentlyHoveringOver.Remove(item);
            }

            if (CurrentlyInteracting != null)
            {
                // TODO: A more general event may be better
                ScenarioLogManager.Instance.LogEvent(this.gameObject, "OnRelease", CurrentlyInteracting.gameObject.name);

                CurrentlyInteracting.EndInteraction();
                CurrentlyInteracting = null;
            }

            if (CurrentInteractionStyle == InteractionStyle.GripToggleToInteract)
            {
                if (CurrentHandState != HandState.Idle)
                {
                    CurrentHandState = HandState.Idle;
                }
            }
        }