The Swipe Menu template is optimized for situations where the user has a small number of options that they need to switch quickly between while still retaining their point-and-click functionality. This is achieved by using swipe gestures on the touch pad to switch between actions or modes while displaying feedback on the controller model.
In general, this type of menu is best suited for aplications that involve fast reflexes and require unobtrusive execution of commands or mode switching. For instance, swiping up could switch between ranged and melee combat in one app, while in another swiping down could invoke an energy shield.
In the provided example, Swipe Menu is used to switch between different colored paper planes that must be launched at matching balloons.
Swipe Menu is available as part of Daydream Elements.
To use Swipe Menu the
SwipeMenu prefab must be added as a child of the
controller prefab, or whatever other object is locked to the wrist.
That are a number of settings associated with the
SwipeMenu prefab that can be
configured to fit your particular use case:
- Icon Radius: The radius in meters between the menu center and the sliding icons.
- Slot Radius: The radius in meters between the menu center and the icon slots.
- Icons: List of sprites to use for the sliding icons (must match size of Slot Icons).
- Slot Icons: List of sprites to use for the slot icons (must match size of Icons).
The number of icons and slot icons will indicate the total number of options available on the menu. The order of the icons should be listed starting from the top and working around clockwise.
Icons and slots can be any shape; arcs as in the demo, circles, or even squares. Icons should avoid text other than very short words as they will be small and difficult to read.
Detecting that a menu option has been triggered can be done by adding a listener
OnSwipeSelect event. The method takes an index argument which
can be used to determine which item was triggered. The index is the same as the
0-indexed order the icons were listed.