Skip to content

Commit a04adb9

Browse files
Stephen HodgsonStephen Hodgson
authored andcommitted
Added check to make sure we didn't already have a gaze stabilization component on our manager.
1 parent fdb1e4a commit a04adb9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Assets/HoloToolkit/Input/Scripts/GazeManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ private void Awake()
8787
{
8888
if (UseBuiltInGazeStabilization)
8989
{
90-
GazeStabilization = gameObject.AddComponent<GazeStabilizer>();
90+
GazeStabilization = gameObject.GetComponent<GazeStabilizer>() ??
91+
gameObject.AddComponent<GazeStabilizer>();
9192
}
9293
}
9394

0 commit comments

Comments
 (0)