using System.Collections; using System.Collections.Generic; using UnityEngine; public class SPPquad : MonoBehaviour { OVRPassthroughLayer passthroughLayer; public MeshFilter projectionObject; OVRInput.Controller controllerHand; void Start() { passthroughLayer = GetComponent(); passthroughLayer.AddSurfaceGeometry(projectionObject.gameObject, false); if (GetComponent()) { GetComponent().GrabbedObjectDelegate += Grab; GetComponent().ReleasedObjectDelegate += Release; } } public void Grab(OVRInput.Controller grabHand) { passthroughLayer.RemoveSurfaceGeometry(projectionObject.gameObject); controllerHand = grabHand; } public void Release() { controllerHand = OVRInput.Controller.None; passthroughLayer.AddSurfaceGeometry(projectionObject.gameObject, false); } }