May 2018
Beginner
492 pages
11h 53m
English
Google Daydream VR on Android may not respond, by default, to Fire1 events. The following code shows how to access controller clicks directly:
private void ButtonTest() { string msg = null; if (GvrControllerInput.ClickButtonDown) msg = "Button down"; if (GvrControllerInput.ClickButtonUp) msg = "Button up"; if (msg != null) Debug.Log("Input: " + msg); }}
In this case, we call the GvrControllerInput class static functions ClickButtonDown and ClickButtonUp. There is no need to identify a specific controller object because GvrControllerInput is a singleton. That is why we're guaranteed to have only one instance of it in the scene, so we can reference its data directly. This makes sense because on Daydream there will ...
Read now
Unlock full access