Setting touch control
Accepting user input will be done as part of a two-step process when the Gear VR's trackpad button is pressed. First, we need to determine if the user clicked on a selectable GameObject: if this is TRUE, we then need to capture which GameObject was selected and, finally we need to switch the FullImage with the image of the current GameObject. We'll address identifying and capturing the GameObject (our Preview images) within the OnPointerDown function.
As mentioned at the start of this chapter, we will use a Graphic Raycaster to project a ray into the scene. However, instead of doing this all the time, we only need to do this when the trackpad button has been pressed. We can then determine if the ray collides with a UI ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access