Question by
elhasimu · Mar 13, 2016 at 08:27 AM ·
scorescore systemreloadscoreboardreloading
reload game
hi im trying to do a scoreboard for my tictactoe game. but i cant reload the game without saving the score board can u help me? if (playing) { Instructions.text = "Turn: " + turn.ToString (); } else if (isDraw()) Instructions.text = "It's a Draw!!"; else
Instructions.text = whoWon().ToString() + " Won!";
if (whoWon () == Seed.NOUGHT) {
oyuncu1++;
} else if (whoWon () == Seed.CROSS) {
oyuncu2++;
}
oyuncu1t.text = "Player1 : " + oyuncu1.ToString ();
oyuncu2t.text = "Player2 : " + oyuncu2.ToString ();
if (!playing)
{
GetDelay();
Application.LoadLevel("2player");
}
}
after loadlevel scores are being erased
Comment
Answer by Avash · Mar 13, 2016 at 02:49 PM
When you load a level it will destroy everything and load everything from the new scene. Make sure the object where the script is doesn't have anything you don't want and use DontDestroyOnLoad(this.gameObject) before loading.