Open charlenedelceppo opened 11 years ago
if(GUI.Button(Rect(xLength-50,yLength,100,30), "Ok")) { //this is reseting all the values to the beginning of the game when click new game SpaceshipController.hit=0; SpaceshipController.score=0; SpaceshipController.health=100; SpaceshipController.fired=0;
//when OK is clicked it will proceed to level 1
Application.LoadLevel(1);
}
}
The problem that I was having is that when I play the game and finishes it and make a new game the results of previous game will still on screen and blink the screen. I didn't have a code in the Menu generator which says that when the new game then OK button is clicked it should reset everything to zero.