@@ -8,7 +8,6 @@ namespace HoloToolkit.Unity
88 /// <summary>
99 /// GazeManager determines the location of the user's gaze, hit position and normals.
1010 /// </summary>
11- [ RequireComponent ( typeof ( GazeStabilizer ) ) ]
1211 public partial class GazeManager : Singleton < GazeManager >
1312 {
1413 /// <summary>
@@ -87,7 +86,10 @@ private void Update()
8786 gazeDirection = Camera . main . transform . forward ;
8887 gazeRotation = Camera . main . transform . rotation ;
8988
90- GazeStabilization . UpdateHeadStability ( gazeOrigin , gazeRotation ) ;
89+ if ( GazeStabilization != null )
90+ {
91+ GazeStabilization . UpdateHeadStability ( gazeOrigin , gazeRotation ) ;
92+ }
9193
9294 UpdateRaycast ( ) ;
9395 UpdateStabilizationPlane ( ) ;
@@ -100,7 +102,15 @@ private void UpdateRaycast()
100102 {
101103 // Get the raycast hit information from Unity's physics system.
102104 RaycastHit hitInfo ;
103- Hit = Physics . Raycast ( GazeStabilization . StableHeadRay , out hitInfo , MaxGazeDistance , RaycastLayerMask ) ;
105+
106+ if ( GazeStabilization != null )
107+ {
108+ Hit = Physics . Raycast ( GazeStabilization . StableHeadRay , out hitInfo , MaxGazeDistance , RaycastLayerMask ) ;
109+ }
110+ else
111+ {
112+ Hit = Physics . Raycast ( gazeOrigin , gazeDirection , out hitInfo , MaxGazeDistance , RaycastLayerMask ) ;
113+ }
104114
105115 GameObject oldFocusedObject = FocusedObject ;
106116
0 commit comments