public void TriggerPressed(InteractorFacade hand) { if (this.createMode) { NodeObject grabbedNode = GrabbedNode(hand); NodeObject otherGrabbedNode = OtherGrabbedNode(hand); if (grabbedNode != null && otherGrabbedNode != null) { MakeConnection(grabbedNode, otherGrabbedNode); } else { NodeObject node = TriggerCreate(head.transform, WhichHand(hand).transform); if (grabbedNode != null) { MakeConnection(grabbedNode, node); } if (otherGrabbedNode != null) { MakeConnection(otherGrabbedNode, node); } } } else if (hovering != null) { hovering.Detach(); Destroy(hovering.gameObject, 0.1f); hovering = null; } }
internal void DeleteObjectAt(NVRHand hand) { Debug.Log("Deleting object interacting with " + hand); if (hand.IsInteracting) { //DebugSphere(hand.CurrentlyInteracting, "Interacting with"); NodeObject sphere = hand.CurrentlyInteracting.GetComponent <NodeObject>(); if (sphere == null) { Debug.Log("Hand is interacting with something that is not a NodeObject: " + hand.CurrentlyInteracting); } else { Debug.Log("Deleting sphere " + sphere); hand.EndInteraction(hand.CurrentlyInteracting); sphere.Detach(); Destroy(sphere.gameObject, 0.1f); } } else if (hand.IsHovering) { Debug.Log("No interacting object, but hand is hovering"); } }