July 2017
Beginner to intermediate
390 pages
10h 53m
English
Add another script to the project and then to the camera. I have called it SurfaceHelper. The initial version looks as follows:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VR.WSA;
public class SurfaceHelper : MonoBehaviour {
SurfaceObserver _observer;
void Start()
{
_observer = new SurfaceObserver();
_observer.SetVolumeAsAxisAlignedBox(Vector3.zero, new Vector3(10f, 10f, 10f));
}
private void HandleSurfaceChanged(
SurfaceId surfaceId,
SurfaceChange changeType,
Bounds bounds,
System.DateTime lastModification)
{
// This is where we handle all changes
}
}
In the Start() method, we initialize the whole thing. First, we create an instance of the SurfaceObserver class. ...
Read now
Unlock full access