-
Notifications
You must be signed in to change notification settings - Fork 6
XRInteractionEventReceiver
The XRInteractionReceiver receives data broadcast by the XRInteractor components. XRInteractionReceiver components get placed on GameObjects which you want to interact with, such as pick up, throw around, or other.
The system comes with a the XRPhysicsInteractor component which implements the necessary base functions for physically based interactions with objects, and also to enable an object to be an Attachable. The XRFreeMovementInteraction implements a set of standard movement behaviors that you would use for picking up objects, or dragging them around with lasers.
For general picking up and moving an object, you can achieve this by placing a XRFreeMovementInteraction, a Collider and a Rigidbody on a GameObject.
The XRInteractionReceiver contains these overridable methods to implement different interactions.
Note: The button events which get forwarded from a controller are set on XRInteractor via the 'Forwarded Button Events' property.'
Method | Description |
---|---|
OnFirstEnter | Called when the first XRInteractor comes into contact with this receiver. |
OnEnter | Called for every XRInteractor that comes into contact this receiver. |
OnStay | Called every frame for every XRInteractor which remains in contact with this reciever. |
OnInteractorsHovering | Called once a frame while any XRInteractor remain in contact with this receiver |
OnExit | Called for every XRInteractor that is no longer in contact with this receiver. |
OnLastExit | Called the last XRInteractor in contact with this reciever is not longer in contact |
OnButtonDown | Called for every button pressed down on a controller currently in contact with this receiver. |
OnButtonHold | Called every frame, for every button held down on a controller currently in contact with this receiver. |
OnButtonsHeld | Called once a frame while any buttons are held down. |
OnButtonUp | Called for every button released on a controller currently in contact with this receiver. |