File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,12 @@ private void Update()
138138
139139 private bool FindGazeTransform ( )
140140 {
141- GazeTransform = GazeTransform ?? CameraCache . Main . transform ;
142- if ( GazeTransform != null ) return true ;
141+ if ( GazeTransform != null ) { return true ; }
142+ if ( CameraCache . Main != null )
143+ {
144+ GazeTransform = CameraCache . Main . transform ;
145+ return true ;
146+ }
143147
144148 Debug . LogError ( "Gaze Manager was not given a GazeTransform and no main camera exists to default to." ) ;
145149 return false ;
Original file line number Diff line number Diff line change @@ -20,7 +20,11 @@ public static Camera Main
2020 {
2121 get
2222 {
23- return cachedCamera ?? Refresh ( Camera . main ) ;
23+ if ( cachedCamera == null )
24+ {
25+ return Refresh ( Camera . main ) ;
26+ }
27+ return cachedCamera ;
2428 }
2529 }
2630
You can’t perform that action at this time.
0 commit comments