77using System . IO ;
88using System . Linq ;
99using UnityEngine . EventSystems ;
10+ using HoloToolkit . Unity . InputModule ;
1011
1112#if UNITY_2017_2_OR_NEWER
1213using UnityEngine . XR . WSA . Input ;
1314#else
1415using UnityEngine . VR . WSA . Input ;
1516#endif
1617
17- #if UNITY_5_3 || UNITY_5_3_OR_NEWER
18- using UnityEngine . SceneManagement ;
19- #endif
2018using OpenCVForUnity ;
2119
2220namespace HoloLensWithOpenCVForUnityExample
@@ -30,7 +28,7 @@ namespace HoloLensWithOpenCVForUnityExample
3028 /// https://docs.opencv.org/3.4.0/d7/d21/tutorial_interactive_calibration.html
3129 /// </summary>
3230 [ RequireComponent ( typeof ( HololensCameraStreamToMatHelper ) ) ]
33- public class HoloLensArUcoCameraCalibrationExample : MonoBehaviour
31+ public class HoloLensArUcoCameraCalibrationExample : ExampleSceneBase
3432 {
3533 /// <summary>
3634 /// The preview quad.
@@ -207,6 +205,10 @@ public class HoloLensArUcoCameraCalibrationExample : MonoBehaviour
207205 // Use this for initialization
208206 IEnumerator Start ( )
209207 {
208+ camera = FindObjectOfType < HoloToolkit . Unity . InputModule . MixedRealityCameraManager > ( ) ;
209+ cursor = FindObjectOfType < HoloToolkit . Unity . InputModule . Cursor > ( ) ;
210+ input = FindObjectOfType < HoloToolkit . Unity . InputModule . InputManager > ( ) ;
211+
210212 webCamTextureToMatHelper = gameObject . GetComponent < HololensCameraStreamToMatHelper > ( ) ;
211213
212214 // fix the screen orientation.
@@ -897,11 +899,7 @@ void OnDestroy ()
897899 /// </summary>
898900 public void OnBackButtonClick ( )
899901 {
900- #if UNITY_5_3 || UNITY_5_3_OR_NEWER
901- SceneManager . LoadScene ( "HoloLensWithOpenCVForUnityExample" ) ;
902- #else
903- Application . LoadLevel ( "HoloLensWithOpenCVForUnityExample" ) ;
904- #endif
902+ LoadScene ( "HoloLensWithOpenCVForUnityExample" ) ;
905903 }
906904
907905 /// <summary>
@@ -1128,8 +1126,10 @@ private void OnTappedEvent (TappedEventArgs args)
11281126 private void OnTappedEvent ( InteractionSourceKind source , int tapCount , Ray headRay )
11291127 #endif
11301128 {
1131- if ( EventSystem . current . IsPointerOverGameObject ( ) )
1129+ // Determine if a Gaze pointer is over a GUI.
1130+ if ( GazeManager . Instance . HitObject != null && GazeManager . Instance . HitObject . transform . name == "Text" ) {
11321131 return ;
1132+ }
11331133
11341134 OnCaptureButtonClick ( ) ;
11351135 }
0 commit comments