File tree Expand file tree Collapse file tree 3 files changed +8
-11
lines changed
Assets/MixedRealityToolkit Expand file tree Collapse file tree 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,9 @@ private void Awake()
228228
229229 private void Start ( )
230230 {
231+ Debug . Assert ( MixedRealityManager . IsInitialized , "No Mixed Reality Manager found in the scene. Be sure to run the Mixed Reality Configuration." ) ;
232+ Debug . Assert ( InputSystem != null , "No Input System found, Did you set it up in your configuration profile?" ) ;
233+
231234 // Register the FocusProvider as a global listener to get input events.
232235 InputSystem . Register ( gameObject ) ;
233236 }
Original file line number Diff line number Diff line change @@ -208,6 +208,9 @@ protected virtual void OnEnable()
208208
209209 private void Start ( )
210210 {
211+ Debug . Assert ( MixedRealityManager . IsInitialized , "No Mixed Reality Manager found in the scene. Be sure to run the Mixed Reality Configuration." ) ;
212+ Debug . Assert ( InputSystem != null , "No Input System found, Did you set it up in your configuration profile?" ) ;
213+
211214 if ( cursorPrefab != null )
212215 {
213216 var cursorObj = Instantiate ( cursorPrefab , transform ) ;
Original file line number Diff line number Diff line change @@ -16,24 +16,15 @@ public static class CameraCache
1616 /// <summary>
1717 /// Returns a cached reference to the main camera and uses Camera.main if it hasn't been cached yet.
1818 /// </summary>
19- public static Camera Main
20- {
21- get
22- {
23- if ( cachedCamera == null )
24- {
25- return Refresh ( Camera . main ) ;
26- }
27- return cachedCamera ;
28- }
29- }
19+ public static Camera Main => cachedCamera == null ? Refresh ( Camera . main ) : cachedCamera ;
3020
3121 /// <summary>
3222 /// Set the cached camera to a new reference and return it
3323 /// </summary>
3424 /// <param name="newMain">New main camera to cache</param>
3525 public static Camera Refresh ( Camera newMain )
3626 {
27+ Debug . Assert ( newMain != null , "No camera with MainCamera tag found in scene. Did you forget to tag your camera?" ) ;
3728 return cachedCamera = newMain ;
3829 }
3930 }
You can’t perform that action at this time.
0 commit comments