Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
return a null camera if we're shutting down
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Nov 6, 2019
1 parent 7b15db0 commit d408f1d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions XRTK-Core/Packages/com.xrtk.core/Utilities/CameraCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEngine;
using XRTK.Services;

namespace XRTK.Utilities
{
Expand All @@ -24,6 +25,11 @@ public static Camera Main

if (mainCamera == null)
{
if (MixedRealityToolkit.IsApplicationQuitting)
{
return null;
}

mainCamera = new GameObject("Main Camera", typeof(Camera), typeof(AudioListener)) { tag = "MainCamera" }.GetComponent<Camera>();
}

Expand Down

0 comments on commit d408f1d

Please sign in to comment.