Panel Menu Item Controller
Overview
Purpose: panel item controller class that intercepts the controller events sent from a [PanelMenuController] and passes them onto additional custom event subscriber scripts, which then carry out the required custom UI actions.
This script should be attached to a VRTK_InteractableObject > [PanelMenuController] > [panel items container] > child GameObject (See the [PanelMenuController] class for more details on setup structure.).
To show / hide a UI panel, you must first pick up the VRTK_InteractableObject and then by pressing the touchpad top/bottom/left/right you can open/close the child UI panel that has been assigned via the Unity Editor panel.
Class Events
PanelMenuItemShowing
- Emitted when the panel menu item is showing.PanelMenuItemHiding
- Emitted when the panel menu item is hiding.PanelMenuItemSwipeLeft
- Emitted when the panel menu item is open and the user swipes left on the controller touchpad.PanelMenuItemSwipeRight
- Emitted when the panel menu item is open and the user swipes right on the controller touchpad.PanelMenuItemSwipeTop
- Emitted when the panel menu item is open and the user swipes top on the controller touchpad.PanelMenuItemSwipeBottom
- Emitted when the panel menu item is open and the user swipes bottom on the controller touchpad.PanelMenuItemTriggerPressed
- Emitted when the panel menu item is open and the user presses the trigger of the controller holding the interactable object.
Event Payload
GameObject interactableObject
- The GameObject for the interactable object the PanelMenu is attached to.
Class Methods
SetPanelMenuItemEvent/1
public virtual PanelMenuItemControllerEventArgs SetPanelMenuItemEvent(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
PanelMenuItemControllerEventArgs
- The payload for the event.
The SetPanelMenuItemEvent is used to build up the event payload.
Show/1
public virtual void Show(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The Show method is used to show the menu.
Hide/1
public virtual void Hide(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The Hide method is used to show the menu.
SwipeLeft/1
public virtual void SwipeLeft(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The SwipeLeft method is used when the control is swiped left.
SwipeRight/1
public virtual void SwipeRight(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The SwipeRight method is used when the control is swiped right.
SwipeTop/1
public virtual void SwipeTop(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The SwipeTop method is used when the control is swiped up.
SwipeBottom/1
public virtual void SwipeBottom(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The SwipeBottom method is used when the control is swiped down.
TriggerPressed/1
public virtual void TriggerPressed(GameObject interactableObject)
- Parameters
GameObject interactableObject
- The object the menu is attached to.- Returns
- none
The TriggerPressed method is used when the control action button is pressed.
Example
040_Controls_Panel_Menu
contains three basic interactive object examples of the PanelMenu in use.
Updated less than a minute ago