Input event stop working correctly after LoadScene
Hi everybody, I have a problem handling mouse events after SceneManager.LoadScene(sceneIndex);. I'll try to explain you.
My game has four scenes: starting menu, first and second level, last level.
To start the game is mandatory a left click and from here come the problems: I've added a debug console that prints the status of GameHandler every single Update(), along with a tick variable to be sure that updates take place.
I can see the tick counter growing as expected, but starting the game with leftclick, the variable that has the game state (to begin - running - ended) is not updated. The odd thing is that the game state variable is actually updated, I can't only see the video reply and I'm very sure of this because the game could not go on if that were false.
Once the level is done and the following loaded, everything seem to work fine (even the broken video replies), but, in the final scene, I can see the "Play Again" button, but no event is raised at the click: if I go over (OnMouseOver) the color switches correctly, like while pressing it (OnMouseDown), but releasing it the color go back to OnMouseOver to stay there until I click somewhere else.
I'm almost sure of my job, even because if I debug starting from game over scene the "Play Again" button works fine and the "New Game" is now broken.
I'm very upset and I don't know where to find a solution: any hints?