I working in small game project.And once upon a time my function OnGUI ceased to update anything i wrote .And now in detail.I had single javaScript in my project with OnGUI function. Like this
static var score : int=10;
functoin OnGUI(){
GUI.Label(Rect(10,10,100,30),"game score = " +score);
}
Today I have wanted to change my GUI.label and i chenge it to GUI.Label(Rect(10,10,100,30),"SCORE = " +score); ,press “Save” compile etc… press “Play” in editor ,and i see in Editor window SCORE = 10 here is everything is O.K.,but when i have build my game in WebPlayer, on screen appeared aging GUI string “game score = 10”,but score value “static var score” still updating when im killing anemies so i saw “game score = 11” , "“game score = 12” …etc.Afterwards I have tried to completely delete line " GUI.Label(Rect(10,10,100,30),"game score = " +score); "-nothing happend :(,then I have tried to create new scene,and new javascript like “test.js” ,and insert there a trivial function :
function OnGUI(){
GUI.Label(Rect(10,10,100,100),“asdasd”);
}
Attach script to the epmty gameObject ,Save,compile ,press Play…-in Editor averything ok,it is seen “asdasd” in the screen,but after export to WebPlayer or,Windows,Macos-nothing happend again,Empty screen :((
After whole of this I created new project,and do the same steps → function OnGUI(){
GUI.Label(Rect(10,10,100,100),“asdasd”);
}
attached to the empty gameobject,pressing Play-everything fine in editor,then i export ,and everything fine in WebPlayer !! I see my “asdasdasd” in WEbPlayer now !!!
How can i save my old project where OnGUI doesnt work :((