Guides
These docs are for v3.2.0. Click to read the latest docs for v3.3.0.

Panel Menu Controller

Overview

Purpose: top-level controller class to handle the display of up to four child PanelMenuItemController items which are displayed as a canvas UI panel.

This script should be attached to a VRTK_InteractableObject > first child GameObject [PanelMenuController].
The [PanelMenuController] must have a child GameObject [panel items container].
The [panel items container] must have a Canvas component.
A [panel items container] can have up to four child GameObject, each of these contains the UI for a panel that can be displayed by [PanelMenuController].
They also have the [PanelMenuItemController] script attached to them. The [PanelMenuItemController] script intercepts the controller events sent from this [PanelMenuController] and passes them onto additional custom event subscriber scripts, which then carry out the required custom UI actions.
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. Button type UI actions are handled by a trigger press when the panel is open.

Inspector Parameters

  • Rotate Towards: The GameObject the panel should rotate towards, which is the Camera (eye) by default.
  • Zoom Scale Multiplier: The scale multiplier, which relates to the scale of parent interactable object.
  • Top Panel Menu Item Controller: The top PanelMenuItemController, which is triggered by pressing up on the controller touchpad.
  • Bottom Panel Menu Item Controller: The bottom PanelMenuItemController, which is triggered by pressing down on the controller touchpad.
  • Left Panel Menu Item Controller: The left PanelMenuItemController, which is triggered by pressing left on the controller touchpad.
  • Right Panel Menu Item Controller: The right PanelMenuItemController, which is triggered by pressing right on the controller touchpad.

Class Methods

ToggleMenu/0

public virtual void ToggleMenu()

  • Parameters
  • none
  • Returns
  • none

The ToggleMenu method is used to show or hide the menu.

ShowMenu/0

public virtual void ShowMenu()

  • Parameters
  • none
  • Returns
  • none

The ShowMenu method is used to show the menu.

HideMenu/1

public virtual void HideMenu(bool force)

  • Parameters
  • bool force - If true then the menu is always hidden.
  • Returns
  • none

The HideMenu method is used to hide the menu.

HideMenuImmediate/0

public virtual void HideMenuImmediate()

  • Parameters
  • none
  • Returns
  • none

The HideMenuImmediate method is used to immediately hide the menu.

Example

040_Controls_Panel_Menu contains three basic interactive object examples of the PanelMenu in use.