I am attempting to generate a map from another script that is not using unity’s base files and when I run the game it throws this exception:
MissingReferenceException: The object of type ‘GameManager’ 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.
UnityEditor.GenericInspector.GetOptimizedGUIBlock (Boolean isDirty, Boolean isVisible, UnityEditor.OptimizedGUIBlock& block, System.Single& height) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GenericInspector.cs:19)
UnityEditor.InspectorWindow.FlushOptimizedGUIBlock (UnityEditor.Editor editor) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1430)
UnityEditor.InspectorWindow.FlushOptimizedGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1420)
What am I doing wrong?
I have attached the two scripts below, if you have any questions please feel free to ask, and thanks for the help!
EDIT: Never mind, I got it.
EDIT: I got it working by re-initializing the scripts, just deleting them and starting over, sometimes unity acts weird and so restarting unity or your computer can sometimes help in situations like these.
2617354–183676–GameManager.cs (1.1 KB)
2617354–183677–MapGenScript.cs (1017 Bytes)