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