Xain
1
Hello, im using C# and i want to add score to game over screen but there is have a problem
if (Application.LoadLevel("gameOver"))
GUI.Box (new Rect(50,50,100,100), score.ToString);
it gives me “Cannot implicity covert type ‘void’ to ‘bool’” error.
Thanks for answers.
Because Application.LoadLevel is void function and returns nothing. Inside if you must only write expressions that will return true or false value.
I think youshould write something like that:
// Call elsewhere to load GameOver scene
Application.LoadLevel("gameOver");
// then
if (Application.loadedLevelName == "GameOver") {
// do something
}