I have an odd thing that just started occurring after I upgraded to Unity 2020.1.
I have a Random occurrence of Null Reference exceptions when I stop play that always occurs on the override OnEnd() method in Tasks that were running when I stopped play. The Null Reference always refers to a GameManager.Instance Singleton gameobject (DontDestroyOnLoad). I use it for some static references to settings and scriptableObjects. I access the GameManger. Instance in OnEnd() because there are some settings that need to be reset when those tasks end.
I can avoid the Null Refs upon Quit if I do Null checks in every OnEnd() task bypassing the GameManager.Instance but that seems hacky.
What I don't understand is why OnEnd() would still be running after OnApplicationQuit() has been called.
Thanks
Allan
I have a Random occurrence of Null Reference exceptions when I stop play that always occurs on the override OnEnd() method in Tasks that were running when I stopped play. The Null Reference always refers to a GameManager.Instance Singleton gameobject (DontDestroyOnLoad). I use it for some static references to settings and scriptableObjects. I access the GameManger. Instance in OnEnd() because there are some settings that need to be reset when those tasks end.
I can avoid the Null Refs upon Quit if I do Null checks in every OnEnd() task bypassing the GameManager.Instance but that seems hacky.
Code:
if (GM.Instance == null)
Debug.Log("GameManager Instance is Null");
else
{
charCapsuleCollider.material = GM.Instance.ColSettings.defaultEnemy;
animator.SetBool(GM.Instance.GMSettings.climb, false);
}
What I don't understand is why OnEnd() would still be running after OnApplicationQuit() has been called.
Thanks
Allan