Hello, there is a problem with my game: after I play it and open main menu the following error is showing up many times. As much as I can understand, Idnet.cs is trying to access an object that is destroyed, so how can I fix this? May it be a problem with my code, or maybe it’s problem with Idnet.cs? I’ve tried to make Idnet.cs to check if he’s trying to access a null object, but I can’t make it work right.
MissingReferenceException: The object of type ‘GameUI’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponent[GameManager] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineComponentBindings.gen.cs:45)
GameUI.m__3 (KeyValuePair2 keyValuePair, System.Exception getException) (at Assets/AirStrike/Scripts/GameManager/GameUI.cs:177) Idnet+<CR_ProcessAsync>c__Iterator2
1[System.Collections.Generic.KeyValuePair`2[System.String,System.Int32]].MoveNext () (at Assets/Idnet/Idnet.cs:1878)