July 2017
Beginner to intermediate
390 pages
10h 53m
English
Now it is time for some scripting. We will first add a script that intercepts the air-tap so we can use that to test our code. You should know how to do that by now, but here it is anyway.
Add a new folder to the project, named Scripts. Add to that a script; let us call it GestureHelper. Remember, Unity3D adds the .cs extension to our file so we do not have to do this ourselves. The script should be attached to the camera, and it looks as follows:
using UnityEngine;using UnityEngine.VR.WSA.Input;public class GestureHelper : MonoBehaviour{ [SerializeField] [Tooltip("The object with an audiosource.")] private GameObject _objectContainingVoice; private void Start() { var rec = new GestureRecognizer(); rec.SetRecognizableGestures(GestureSettings.Tap); ...Read now
Unlock full access