Hello,
I want to restart a scene and get the player to the actual game part (My whole game is one scene).
So at the beginning there is a menu with a button play, to actually start playing.
When the player fails, a game-over screen appears with the buttons retry and menu.
The menu-button has this function to be executed:
function OnQuitSinglePlayer(){
Application.LoadLevel(0);
}
This works as the player wanted to get to the menu and since the game starts with that it is all good.
The retry-button has to restart the scene too, but should also simulate the play-button press, to actually skip the menu-showup:
function OnRetrySinglePlayer(){
Application.LoadLevel(0);
b_play.transform.GetComponent.<UI.Button>().onClick;
}
However this don’t work.
I think the EventSystems.ExecuteEvent-class is the right direction on this issue.
Any help is appreciated!