Beispiel #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;
                }
            }
        }
Beispiel #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;
                }
            }
        }
Beispiel #3
0
        public void EndInteraction(NVRInteractable item)
        {
            if (item != null && CurrentlyHoveringOver.ContainsKey(item) == true)
            {
                CurrentlyHoveringOver.Remove(item);
            }

            if (CurrentlyInteracting != null)
            {
                CurrentlyInteracting.EndInteraction();
                CurrentlyInteracting = null;
            }
        }
Beispiel #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;
                }
            }
        }