【Unity】MirageSoloアプリ開発 2019edition – コントローラー入力
2019-03-17 2019-05-18
OverView
GVR SDK 2019年版におけるコントローラーのクリックイベント受取りEnvironment
Windows10 64bit Unity2018.2.14f1 Google VR SDK – GVR SDK for Unity v1.190.1 (2019-01-16) Lenovo Mirage Solo – Android 8.0.0Method

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ControllerInput : MonoBehaviour { private static readonly GvrControllerHand[] AllHands = { GvrControllerHand.Right, GvrControllerHand.Left, }; void Update () { foreach (var hand in AllHands) { GvrControllerInputDevice device = GvrControllerInput.GetDevice(hand); if (device.GetButtonDown(GvrControllerButton.TouchPadTouch)) { Debug.Log("touch"); //(1)がタッチされたとき } if (device.GetButtonDown(GvrControllerButton.TouchPadButton)) { Debug.Log("button"); //(1)が押されたとき } if (device.GetButtonDown(GvrControllerButton.App)) { Debug.Log("app"); //(2)が押されたとき } } } } |
https://support.google.com/daydream/answer/7185269?hl=ja:title から拝借した.