I’m really hoping for some help here - any suggestions appreciated.
Here’s my code. This exists in a single script attached to an object that exists at design time:
@HideInInspector
var tutorialState:int = 0;
@HideInInspector
var tutorialTitles:Array = new Array();
tutorialTitles.push("Title From Array");
@HideInInspector
var tutWindow:Rect = Rect(300,20,500,60);
function OnGUI ()
{
var titleText = tutorialTitles[tutorialState];
print(titleText);
// only show tutorial window if tutorial state is meaningful
if (tutorialState > -1)
{
// tutWindow = GUI.Window (0, tutWindow, DrawTutorialText, titleText);
tutWindow = GUI.Window (0, tutWindow, DrawTutorialText, "Some Title");
}
}
function DrawTutorialText()
{
GUI.Label(Rect(5,5,190,35),"Some Text Or Other");
}
When I run the project with the first “tutWindow = GUI.Window …” commented, it works fine and displays the window with Some Time as the title. It also prints “Title From Array” to the log.
When I switch the commented lines so that the second “tutWindow = GUI.Window…” is commented, the project compiles and runs, but I get “MissingMethodException: Method not found: UnityEngine.GUI.Window”, and the window of course doesn’t show. “Title From Array” is still written to the log.
This error is maddeningly non-sensical, and after three hours of trying everything I know to fix it I am seriously considering throwing the computer out the window. So, any help would be appreciated. Or, you can stand below my office window and catch a free computer in another hour or two. Just watch out for the glass shards.
Cheers,
Sean
edit: just in case it matters, Unity 3.30 (63135) on a Mac