I understand the following error message is caused when (in general) Unity is telling me that one of the things in line 54 of the myProg script doesn't exist:
NullReferenceException: Object reference not set to an instance of an object
myProg.OnGUI () (at Assets/Scripts/Editors/myProg.cs:54)
But as far as I can see and figure, there is nothing missing there in any way...
Here is the relevant part of the code snippet, and line 54 is the bit with .enabled
(middle line):
if( GUILayout.Button("SART07Johnson") )
{
stage.setFatigueInductor( new Sart07JohnsonDefinition(GetComponent<ExperimentCreator>().getExperiment().getAvailableTableName("SART07Johnson")) );
stage.setTypeOfFI( FatigueType.SART07Johnson );
SART07JohnsonEditor editorSart07Johnson = GetComponent<SART07JohnsonEditor>();
editorSart07Johnson.enabled = true;
editorSart07Johnson.Init( (Sart07JohnsonDefinition)stage.getFatigueInductor(), this.stage.StageName,GetComponent<ExperimentCreator>().getExperiment().GetExperimentName() );
GetComponent<NavigationTree>().CurrentEditor = editorSart07Johnson;
this.enabled = false;
}
So, I am wondering... what else could be the problem? Any specific other reason that I could look into, that might be causing this error message to be generated?