Skip to content

Commit

Permalink
don't report error if our obj is destroyed but game is quitting
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddio0141 committed Sep 2, 2024
1 parent ce5ca91 commit 0ddc562
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ private void Awake()
StartCoroutine(FixedUpdateCoroutine());
}

private bool _quitting;

private void OnApplicationQuit()
{
_quitting = true;
}

private void OnDestroy()
{
_logger.LogError("MonoBehaviourUpdateInvoker destroyed, this should not happen");
if (!_quitting)
_logger.LogError("MonoBehaviourUpdateInvoker destroyed, this should not happen");
}

private void Start()
Expand Down

0 comments on commit 0ddc562

Please sign in to comment.